From 024534da5f5484cc88b96247f3bf604d97784caf Mon Sep 17 00:00:00 2001 From: "Marcel S. Henselin" Date: Fri, 30 Jan 2026 13:50:39 +0000 Subject: [PATCH] fix: fix releaser to use correct string format in gpg strings (#22) ## Description relates to #1234 ## Checklist - [ ] Issue was linked above - [ ] Code format was applied: `make fmt` - [ ] Examples were added / adjusted (see `examples/` directory) - [x] Docs are up-to-date: `make generate-docs` (will be checked by CI) - [ ] Unit tests got implemented or updated - [ ] Acceptance tests got implemented or updated (see e.g. [here](https://github.com/stackitcloud/terraform-provider-stackit/blob/f5f99d170996b208672ae684b6da53420e369563/stackit/internal/services/dns/dns_acc_test.go)) - [x] Unit tests are passing: `make test` (will be checked by CI) - [x] No linter issues: `make lint` (will be checked by CI) Reviewed-on: https://tf-provider.git.onstackit.cloud/stackit-dev-tools/terraform-provider-stackitprivatepreview/pulls/22 Co-authored-by: Marcel S. Henselin Co-committed-by: Marcel S. Henselin --- cmd/cmd/publish/gpg.go | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) 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 }