In this lecture, we will look at two very common patterns based on
map in
Go: a set via
map
[
T
]
struct
{} and frequency counters via
map
[
string
]
int. We will talk about
make, zero value, the ok idiom (
v, ok := m[key]), safe
delete, stable output through key sorting, and typical mistakes with
nil-maps and
map
[
string
]
bool.