mirror of
https://github.com/Threnklyn/advent-of-code-go.git
synced 2026-06-04 03:08:27 +02:00
update util.ReadFile to trim whitespace
This commit is contained in:
+4
-1
@@ -5,6 +5,7 @@ import (
|
||||
"log"
|
||||
"path"
|
||||
"runtime"
|
||||
"strings"
|
||||
)
|
||||
|
||||
/*
|
||||
@@ -27,5 +28,7 @@ func ReadFile(pathFromCaller string) string {
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
return string(content)
|
||||
// trim off new lines at end of input files
|
||||
strContent := string(content)
|
||||
return strings.TrimSpace(strContent)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user