Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
word count with go
package main
import (
var m map[string]int
func WordCount(s string) map[string]int {
sub_string := strings.Fields(s)
m = make(map[string]int)
for i := 0 ; i < len(sub_string); i++ {
return m
func main() {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment