Basics
A map maps keys to values, ie: associative arrays. Zero value of a map
is nil
. make
function returns a new map
.
Map literals
These are essentially the same as struct
literals, keys are required.
If top-level type is just a type name, it can be omitted from literal
elements. Saves some typing.
Mutating maps
Nothing shocking here either. Map elements can be
added/deleted/modified/etc.
Types
A type
can be declared as a thin wrapper around a map
: