From a96ffa51ce0bafbbf1fc1b09faf0bbfe2464ef80 Mon Sep 17 00:00:00 2001 From: Beatriz Vieira Date: Sat, 31 Jul 2021 16:35:28 -0300 Subject: [PATCH] refactor: fix prealloc lint --- sv/formatter.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sv/formatter.go b/sv/formatter.go index 6509e8b..2fe78f2 100644 --- a/sv/formatter.go +++ b/sv/formatter.go @@ -80,9 +80,9 @@ func (p OutputFormatterImpl) FormatReleaseNote(releasenote ReleaseNote) string { // FormatChangelog format a changelog. func (p OutputFormatterImpl) FormatChangelog(releasenotes []ReleaseNote) string { - var templateVars []releaseNoteTemplateVariables - for _, v := range releasenotes { - templateVars = append(templateVars, releaseNoteVariables(v)) + templateVars := make([]releaseNoteTemplateVariables, len(releasenotes)) + for i, v := range releasenotes { + templateVars[i] = releaseNoteVariables(v) } var b bytes.Buffer