Map type defintion without container
examples/map-no-container/map_no_container.go
package main import "fmt" func main() { var grades map[string]int // defined type but does not create the container for it fmt.Printf("%T\n", grades) // map[string]int grades["Mary"] = 99 }
map[string]int panic: assignment to entry in nil map goroutine 1 [running]: main.main() /home/gabor/work/slides/golang/examples/map-no-container/map_no_container.go:9 +0xba exit status 2