From b67d917837882ea1dd4e114365e5d909fd589d27 Mon Sep 17 00:00:00 2001 From: Jiri Zizkovsky Date: Fri, 26 Apr 2024 16:06:04 +0200 Subject: [PATCH] fix trailing whitespaces in mappings --- cmd/get.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cmd/get.go b/cmd/get.go index 2c4cb46..f708966 100644 --- a/cmd/get.go +++ b/cmd/get.go @@ -3,6 +3,7 @@ package cmd import ( "fmt" "os" + "strings" log "github.com/sirupsen/logrus" "github.com/spf13/cobra" @@ -60,7 +61,7 @@ func ExecuteGetValues() error { log.Debug("Config server response:") log.Debug(resp) - //#nosec G306 + // #nosec G306 if err = os.WriteFile(gp.destination, []byte(resp), 0o644); err != nil { return err } @@ -78,7 +79,7 @@ func ExecuteGetFiles() error { for _, mapping := range gp.fileMappings.Mappings() { resp, err := client. NewClient(client.Config{URI: gp.source, Profile: gp.profile, Application: gp.application, Label: gp.label}). - FetchFileE(mapping.source) + FetchFileE(strings.TrimSpace(mapping.source)) if err != nil { return err } @@ -91,7 +92,7 @@ func ExecuteGetFiles() error { fmt.Println() log.Debug("Response written to stdout") } else { - //#nosec G306 + // #nosec G306 if err = os.WriteFile(mapping.destination, resp, 0o644); err != nil { return err }