Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/golayrva/public_html/app/code/core/Mage/Core/Model/Layout.php on line 443
How to declare empty Map in Go? - golangprograms.com

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