Maps (Dictionaries)

Maps (Dictionaries)

Maps are key-value pairs used for fast lookups.

m := map[string]int{"a": 1, "b": 2} // create a map
m["c"] = 3 // add a key-value pair
delete(m, "a") // remove a key
← PrevNext →