使用Golang计算文本文件中的单例数量

How can I count the number of strings that occurs exactly once in a text file using GO? I have read some of the package description of golang, maybe I should use bufio.NewScanner to read the contents of the passed-in file a line at a time. Then I try to use map to count the occurrence of each string:

stringcount := make(map[string]int)

how can I update the data of this empty map? For example, if the first string is "hello" in the file, how to make stringcount["hello"] = 1?

Here is my try:

package main

import (
    "bufio"
    "fmt"
    "os"
    "strings"
)

func main() {

    frequencyofWord := map[string]int{}

    scanner := bufio.NewScanner(os.Stdin)
    for scanner.Scan() {
        fmt.Println(scanner.Text())
    }
    if err := scanner.Err(); err != nil {
        fmt.Fprintln(os.Stderr, "reading standard input:", err)
    }

    s := strings.Fields(scanner.Text()) //one more question : is strings.Fields used correctly here?
    countSingleton(s)

}

func countSingleton(a []string) {
    //here how to update the map according to the text read ?//
}

Use bufio.NewScanner to break apart the lines, use strings.Fields to get the words, and use yourMap[theWord]++ to count the words.

Example: http://play.golang.org/p/3H6gfBlQL5

To get the list of the unique words, iterate over the map keys and append them to a slice, and then sort them.