https://codeeval.dev/gist/202b9b74c1d7070aeef2ee1ed8a66ce5
Notice that in m["key1"] = append(m["key1"], 8)
we don't have to check if m["key1"]
exists. This is a result of interplay of 3 rules:
m["foo"]
returns zero-value if foo
key is not present is the mapnil
a = append(nil, 3)
is valid and creates a single-element slice []int{3}