Skip to content

Commit

Permalink
handle whitespace characters consistently
Browse files Browse the repository at this point in the history
  • Loading branch information
elsesiy committed Aug 14, 2024
1 parent 44408ee commit bd29a63
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/cmd/view-secret.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit bd29a63

Please sign in to comment.