Create a gist now

Instantly share code, notes, and snippets.

tour of go の例題
package main
import (
"strings"
"golang.org/x/tour/wc"
)
func WordCount(s string) map[string]int {
result := make(map[string]int)
target := strings.Split(s," ")
for _, v := range target {
result[v]++;
}
return result
}
func main() {
wc.Test(WordCount)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment