$ ./guess_the_languageProblem Solving — fix the bug
Problem Solving — fix the bug · easy · #221

Which fix removes the bug?

var counts map[string]int
counts["go"] = 1
  1. Create it with make(map[string]int)
  2. Use counts.Set("go", 1) instead
  3. Write the key as a rune: 'g'
  4. Change the map's value type to int64
A nil map can be read but not written; assigning to it panics until the map is created with make.
Play Problem Solving ▸