From 741ad2d0a7ad6a675ed5311fa8aa4e0e8b79fa74 Mon Sep 17 00:00:00 2001 From: David Wertenteil Date: Thu, 28 Dec 2023 09:33:13 +0200 Subject: [PATCH] trim newline --- pkg/utils/credentials.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/utils/credentials.go b/pkg/utils/credentials.go index 71adef9..00bacbc 100644 --- a/pkg/utils/credentials.go +++ b/pkg/utils/credentials.go @@ -3,6 +3,7 @@ package utils import ( "fmt" "os" + "strings" ) const ( @@ -29,10 +30,10 @@ func LoadCredentialsFromFile(secretPath string) (*Credentials, error) { t := &Credentials{} if accessKey, err := os.ReadFile(accessKeyPath); err == nil { - t.AccessKey = string(accessKey) + t.AccessKey = strings.TrimSuffix(string(accessKey), "\n") } if account, err := os.ReadFile(accountPath); err == nil { - t.Account = string(account) + t.Account = strings.TrimSuffix(string(account), "\n") } return t, nil