fix: do not strip whitespace when displaying a file for debugging purposes

This commit is contained in:
Jose Diaz-Gonzalez
2024-01-18 19:13:44 -05:00
parent 3f96a250a2
commit 8cc822eed0

View File

@@ -12,14 +12,15 @@ import (
// CatFile cats the contents of a file (if it exists)
func CatFile(filename string) {
slice, err := FileToSlice(filename)
f, err := os.Open(filename)
if err != nil {
LogDebug(fmt.Sprintf("Error cat'ing file %s: %s", filename, err.Error()))
return
}
defer f.Close()
for _, line := range slice {
LogDebug(fmt.Sprintf("line: '%s'", line))
scanner := bufio.NewScanner(f)
for scanner.Scan() {
LogDebug(fmt.Sprintf("line: '%s'", scanner.Text()))
}
}