Skip to content

Commit a22ca46

Browse files
author
Paddy Carver
committed
Fix panic, strip .txt from filenames.
Fix a panic that comes from assigning to a nil map, which was programmer error. Strip .txt from the filenames when interpreting them as issue numbers, as we don't want the extension in that case.
1 parent b8850f7 commit a22ca46

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

cmd/changelog-build/main.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"os"
77
"path/filepath"
88
"sort"
9+
"strings"
910
"text/template"
1011

1112
"github.com/hashicorp/go-changelog"
@@ -103,8 +104,11 @@ func main() {
103104
os.Exit(1)
104105
}
105106
var notes []changelog.Note
106-
var notesByType map[string][]changelog.Note
107+
notesByType := map[string][]changelog.Note{}
107108
for _, entry := range entries {
109+
if strings.HasSuffix(entry.Issue, ".txt") {
110+
entry.Issue = strings.TrimSuffix(entry.Issue, ".txt")
111+
}
108112
notes = append(notes, changelog.NotesFromEntry(entry)...)
109113
}
110114
for _, note := range notes {

0 commit comments

Comments
 (0)