mirror of
https://github.com/AmanTahiliani/gophercises.git
synced 2026-08-07 11:53:44 -04:00
Update
This commit is contained in:
@@ -7,7 +7,6 @@ import (
|
|||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -20,7 +19,7 @@ func readCSV(filenName string) [][]string {
|
|||||||
log.Println("Opening CSV file from filepath", filenName)
|
log.Println("Opening CSV file from filepath", filenName)
|
||||||
f, err := os.Open(filenName)
|
f, err := os.Open(filenName)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal("%+v", err)
|
log.Fatal("An error occured", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
defer f.Close()
|
defer f.Close()
|
||||||
@@ -29,7 +28,7 @@ func readCSV(filenName string) [][]string {
|
|||||||
|
|
||||||
records, err := csvReader.ReadAll()
|
records, err := csvReader.ReadAll()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal("%+v", err)
|
log.Fatal("An error occured", err)
|
||||||
}
|
}
|
||||||
return records
|
return records
|
||||||
}
|
}
|
||||||
@@ -52,10 +51,6 @@ func getQuestionsFromCSV(fileName string) []Question {
|
|||||||
return questions
|
return questions
|
||||||
}
|
}
|
||||||
|
|
||||||
func strip(s string) string {
|
|
||||||
return strings.ReplaceAll(s, " ", "")
|
|
||||||
}
|
|
||||||
|
|
||||||
func askQuestion(question Question, c chan int) {
|
func askQuestion(question Question, c chan int) {
|
||||||
var userAnswer int
|
var userAnswer int
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user