On Sun, Aug 9, 2026 at 6:12 PM Tom Limoncelli <[email protected]> wrote:
>
> Why don't maps allocate on the first attempt to store something in them?
>
> We all know that maps need to be initialized:
>
> var m map[string]string
> m["foo"] = bar    // panics on STORE
>
> Why can't it allocate ON FIRST STORE instead of panicking?

Because https://go.dev/play/p/UbN46-c9iyi

-- 
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 [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/golang-nuts/CAA40n-XS%3DUMmc9immQ%2Byguj4vQaa8xiLRVFuXrEheBR1f-aBVg%40mail.gmail.com.

Reply via email to