refactor(changelog): clean up author map

This commit is contained in:
Sebastian
2022-04-11 20:13:26 +02:00
committed by Felix Wiedmann
parent 1d0c93b678
commit fd1063132f

View File

@@ -157,17 +157,11 @@ func (c *Changelog) GenerateChangelog(templateConfig shared.ChangelogTemplateCon
} }
} }
authors := map[string]int{} authors := map[string]bool{}
for _, commits := range analyzedCommits { for _, commits := range analyzedCommits {
for _, commit := range commits { for _, commit := range commits {
authors[commit.Commit.Author] = true
_, ok := authors[commit.Commit.Author]
if !ok {
authors[commit.Commit.Author] = 0
}
authors[commit.Commit.Author] = authors[commit.Commit.Author] + 1
if commit.Print { if commit.Print {
if commit.IsBreaking { if commit.IsBreaking {
commitsBreakingChange = append(commitsBreakingChange, commit) commitsBreakingChange = append(commitsBreakingChange, commit)