trying_out_go/playground/countVotes.go

20 lines
403 B
Go

// from Chapter 7 of Head First Go
package main
import (
"fmt"
"git.linuxhg.com/john-okeefe/datafile"
"git.linuxhg.com/john-okeefe/keyboard"
"strings"
)
func countVotes() {
fmt.Printf("What is the name of the file: ")
fileString, err := keyboard.GetString()
Error(err)
fileString = strings.TrimSpace(fileString)
lines, err := datafile.GetStrings(fileString)
Error(err)
fmt.Println(lines)
}