When slice is nil, appending its value is OK:
var s int
s = append(s, 1)
But when a map is nil, assigning value is not OK, and cause panic:
var m map[string]int
m["Alex"] = 16
Why does golang adopt this design?
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firstname.lastname@example.org.
For more options, visit https://groups.google.com/d/optout.