A map in Go needs to be initialized before you can use it. When you declare var m map[string]int, the map is nil by default.
use m := make(map[string]int)