fix: do not strip whitespace when displaying a file for debugging purposes
This commit is contained in:
@@ -12,14 +12,15 @@ import (
|
|||||||
|
|
||||||
// CatFile cats the contents of a file (if it exists)
|
// CatFile cats the contents of a file (if it exists)
|
||||||
func CatFile(filename string) {
|
func CatFile(filename string) {
|
||||||
slice, err := FileToSlice(filename)
|
f, err := os.Open(filename)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
LogDebug(fmt.Sprintf("Error cat'ing file %s: %s", filename, err.Error()))
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
defer f.Close()
|
||||||
|
|
||||||
for _, line := range slice {
|
scanner := bufio.NewScanner(f)
|
||||||
LogDebug(fmt.Sprintf("line: '%s'", line))
|
for scanner.Scan() {
|
||||||
|
LogDebug(fmt.Sprintf("line: '%s'", scanner.Text()))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user