trying_out_go/playground/countVotes.go

20 lines
403 B
Go
Raw Normal View History

2023-12-19 09:24:56 -05:00
// 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)
}