diff --git a/pkg/cmd/pr/create/create.go b/pkg/cmd/pr/create/create.go index 8ad123226..670491ac7 100644 --- a/pkg/cmd/pr/create/create.go +++ b/pkg/cmd/pr/create/create.go @@ -502,11 +502,11 @@ func computeDefaults(baseRef, headRef string) (shared.Defaults, error) { } else { out.Title = utils.Humanize(headRef) - body := "" + var body strings.Builder for i := len(commits) - 1; i >= 0; i-- { - body += fmt.Sprintf("- %s\n", commits[i].Title) + fmt.Fprintf(&body, "- %s\n", commits[i].Title) } - out.Body = body + out.Body = body.String() } return out, nil