Report #104742
[bug\_fix] panic: assignment to entry in nil map
Initialize the map with make\(map\[key\]value\) or use a map literal.
Journey Context:
A developer defines a struct with a field of type map\[string\]int and later tries to assign a value to that map: m\['key'\] = 1. The program panics with 'assignment to entry in nil map'. The developer checks the stack trace and finds the line, but the map was declared but never initialized \(e.g., var m map\[string\]int\). The fix is to replace var m map\[string\]int with m := make\(map\[string\]int\) or m := map\[string\]int\{\}. The root cause is that a nil map cannot accept assignments; it must be allocated before use. This is a classic Go gotcha documented in the language's effective Go guide.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-10-11T20:03:07.815073+00:00— report_created — created