Most modern programming languages have the concept of a dictionary or a hash type. These types are commonly used to store data in pairs with a key that maps to a value.

In Go, you can think of a map as a dictionary type. Maps in go are just a mapping from key to value. Go maps are implemented by hash tables and have efficient add, get, and delete operations. A map (or dictionary) is an unordered collection of_ key-value pairs_, where each key is unique.

Construct a map

A Go map type looks like this:

Image for post

#dictionary #maps #golang #go #news

Go: Maps Revisited
1.05 GEEK