From bd29a63398c92e41c19d943fa9d76cafaf09edb0 Mon Sep 17 00:00:00 2001 From: Jonas-Taha El Sesiy Date: Tue, 13 Aug 2024 21:09:30 -0700 Subject: [PATCH] handle whitespace characters consistently --- pkg/cmd/view-secret.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/cmd/view-secret.go b/pkg/cmd/view-secret.go index 4b76531..76622c5 100644 --- a/pkg/cmd/view-secret.go +++ b/pkg/cmd/view-secret.go @@ -229,12 +229,12 @@ func ProcessSecret(outWriter, errWriter io.Writer, inputReader io.Reader, secret for k, v := range data { _, _ = fmt.Fprintf(errWriter, singleKeyDescription+"\n", k) b64d, _ := base64.StdEncoding.DecodeString(v) - _, _ = fmt.Fprint(outWriter, string(b64d)) + _, _ = fmt.Fprintf(outWriter, "%s\n", strings.TrimSpace(string(b64d))) } } else if secretKey != "" { if v, ok := data[secretKey]; ok { b64d, _ := base64.StdEncoding.DecodeString(v) - _, _ = fmt.Fprint(outWriter, string(b64d)) + _, _ = fmt.Fprintf(outWriter, "%s\n", strings.TrimSpace(string(b64d))) } else { return ErrSecretKeyNotFound }