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
Functions mess (recursive anonymous function) in Golang
Various examples of printing and formatting in Golang
How to trim leading and trailing white spaces of a string in Golang?
How to add and update elements in Map?
Regular expression to validate common Credit Card Numbers
Dereferencing a pointer from another package