In this lecture, you will break down the “ok idiom” for reading from a
map in
Go: why the expression
m
[
k
] can return a seemingly valid value while still hiding the fact that the key is missing, what
zero value is, how to read
v
,
ok
:=
m
[
k
], and how to avoid common traps using examples with task statuses, discounts, and strings.