A declared but uninitialized map is nil:
var ages map[string]int
fmt.Println(ages == nil) // true
fmt.Println(len(ages)) // 0
_ = ages["Alice"] // returns 0, no panic
ages["Alice"] = 30 // PANIC! assignment to nil map
You can read from a nil map safely. You cannot write to it. Always initialize maps with make or a literal before adding entries.