The hash table is one of the most ingenious and versatile of all data structures. It is an unordered collection of key/value pairs in which all the keys are distinct, and the value associated with a given key can be retrieved, updated, or removed using a constant number of key comparisons on the average, no matter how large the hash table.
In Go, a map is a reference
to a hash table, and a map type
V are the types of its keys
and values. All of
the keys in a given map are of the same type, and all of the values are of the same
type, but the keys need not be of the same type as the values.
The key type
K must be comparable using
==, so that the map can test whether a
given key is equal to one already ...