map[K]V
Try it yourself →Stores key-value pairs.
Syntax
name := map[keyType]valueType{...}Description
Key and value types are specified. The value is accessed by the key.
Example
package main
import "fmt"
func main() {
person := map[string]int{"age": 36}
fmt.Println(person["age"])
}Expected output
36
When to use?
Structured data, counters.