diff --git a/cmd/cmd/publish/gpg.go b/cmd/cmd/publish/gpg.go index 91e244dc..2de4ce33 100644 --- a/cmd/cmd/publish/gpg.go +++ b/cmd/cmd/publish/gpg.go @@ -2,19 +2,13 @@ package publish import ( "fmt" + "strings" ) func (p *Provider) ReadGpgFile() (string, error) { - // Get contents of GPG key gpgFile, err := ReadFile(p.GpgPubKeyFile) if err != nil { return "", fmt.Errorf("error reading '%s' file: %w", p.GpgPubKeyFile, err) } - - // loop through every line and stick with \\n - gpgAsciiPub := "" - for _, line := range gpgFile { - gpgAsciiPub = gpgAsciiPub + line + "\\n" - } - return gpgAsciiPub, nil + return strings.Join(gpgFile, "\n"), nil }