Go Maps

From NovaOrdis Knowledge Base
Jump to navigation Jump to search

External

Internal

Overview

Maps and Pass-by-Value

Pointers to Maps

nil and Empty Map

nil Map

Empty Map

Declaration and Initialization

Initialization with make()

Initialization with a Composite Literal

Composite literals can be used for map initialization.

Long variable declaration and initialization with type inference:

var mm = map[string]int{"A": 1, "B": 2}

Short variable declaration:

mm := map[string]int{"A": 1, "B": 2}

Operators

Indexing Operator []

Map Functions

delete()

len()

make()

new()

Iterating over a Map

TODO

Go_Maps_TODEPLETE