fix(settings): trim trailing new line from files

This commit is contained in:
Quentin McGaw (desktop)
2022-01-19 00:38:04 +00:00
parent 7a50daca7c
commit a1a1128d6d

View File

@@ -3,6 +3,7 @@ package files
import ( import (
"io" "io"
"os" "os"
"strings"
) )
// ReadFromFile reads the content of the file as a string. // ReadFromFile reads the content of the file as a string.
@@ -27,5 +28,7 @@ func ReadFromFile(filepath string) (s *string, err error) {
} }
content := string(b) content := string(b)
content = strings.TrimSuffix(content, "\r\n")
content = strings.TrimSuffix(content, "\n")
return &content, nil return &content, nil
} }