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