Text - String in Go
The following declarations are all equivalent:
// The short variable declaration (only within a function, not for package-level variables)
s := ""
// Initialized to the default ""
var s string
var s = ""
var s string = ""
For:
Scanner that reads input and breaks it into lines or words;
Example: get a count of text on a line. All duplicate have more than one counts.
func countLines(f *os.File, counts map[string]int) {
input := bufio.NewScanner(f)
for input.Scan() {
counts[input.Text()]++
}
}