From 747e7697614db5a9323c97c5b63cc39fa0f7e02a Mon Sep 17 00:00:00 2001 From: Jean-Marc MEESSEN Date: Thu, 25 Jun 2020 21:35:08 +0200 Subject: [PATCH] Add error checking bufio scanner (just in case) --- cmd/load.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd/load.go b/cmd/load.go index bc96e29..79181be 100644 --- a/cmd/load.go +++ b/cmd/load.go @@ -72,6 +72,10 @@ func loadFile() { txtlines = append(txtlines, scanner.Text()) } + if error := scanner.Err(); error != nil { + log.Fatal(error) + } + file.Close() regexpLineComment, _ := regexp.Compile("^#")