(state map[string]int, animal string)
| 89 | } |
| 90 | |
| 91 | func countAnimals(state map[string]int, animal string) map[string]int { |
| 92 | count, ok := state[animal] |
| 93 | if !ok { |
| 94 | state[animal] = 1 |
| 95 | return state |
| 96 | } |
| 97 | |
| 98 | state[animal] = count + 1 |
| 99 | return state |
| 100 | } |
| 101 | |
| 102 | func TestReduce(t *testing.T) { |
| 103 | arr := []string{"cat", "dog", "cat", "cow"} |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…