From a1a1128d6de28aa720492d5502f754e315d4ad54 Mon Sep 17 00:00:00 2001 From: "Quentin McGaw (desktop)" Date: Wed, 19 Jan 2022 00:38:04 +0000 Subject: [PATCH] fix(settings): trim trailing new line from files --- internal/configuration/sources/files/helpers.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/configuration/sources/files/helpers.go b/internal/configuration/sources/files/helpers.go index a2aea24b..aba1a5fd 100644 --- a/internal/configuration/sources/files/helpers.go +++ b/internal/configuration/sources/files/helpers.go @@ -3,6 +3,7 @@ package files import ( "io" "os" + "strings" ) // 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 = strings.TrimSuffix(content, "\r\n") + content = strings.TrimSuffix(content, "\n") return &content, nil }