How to declare empty Map in Go?
In this example an empty map
employee
is declared outside main
function.
Example
package main
import "fmt"
var employee = map[string]int{}
func main() {
fmt.Println(employee)
}
Output
map[]
Most Helpful This Week
How to copy a map to another map?
Example Function that takes an interface type as value and pointer?
How to extract text from between html tag using Regular Expressions in Golang?
How to concatenate two or more slices in Golang?
Regular expression to extract all Non-Alphanumeric Characters from a String
Example to create custom error