Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

dhoss's scratchpad

by stonecolddevin (Parson)
on Jun 02, 2004 at 01:49 UTC ( [id://358977] : scratchpad . print w/replies, xml ) Need Help??

package main import ( "strings" "code.google.com/p/go-tour/wc" ) func WordCount(s string) map[string]int { words := strings.Fields(s) wordCount := make(map[string]int) for i := range words { wordCount[words[i]]++ } return wordCount } func main() { wc.Test(WordCount) }