Is there anything written down on why assignment to a nil map causes a 
panic? I'm curious if there were carefully considered tradeoffs while 
making this decision.

Assignment to nil maps has caused most of the unexpected panics I've seen. 
Many times these happen in production and cause an incident. Every time it 
happens I think, "we've got to do something about this."

I'm not sure what the best solution is yet, but there must be something 
better than the status quo. Would it be possible to have assignments 
automatically initialize a nil map?

Thanks,
Alex

-- 
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 golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/94f7ab01-f2c3-4fe6-8503-a831ffb46615%40googlegroups.com.

Reply via email to