diff --git a/ansible/executor.go b/ansible/executor.go index 08ea851..54a82ba 100644 --- a/ansible/executor.go +++ b/ansible/executor.go @@ -5,6 +5,7 @@ import ( "fmt" "os" "regexp" + "slices" "strings" "sync" "text/template" @@ -920,20 +921,16 @@ func (e *Executor) matchesTags(taskTags []string) bool { // Check skip tags for _, skip := range e.SkipTags { - for _, tt := range taskTags { - if skip == tt { - return false - } + if slices.Contains(taskTags, skip) { + return false } } // Check include tags if len(e.Tags) > 0 { for _, tag := range e.Tags { - for _, tt := range taskTags { - if tag == tt || tag == "all" { - return true - } + if tag == "all" || slices.Contains(taskTags, tag) { + return true } } return false diff --git a/release/changelog.go b/release/changelog.go index c25fc52..ba74eb4 100644 --- a/release/changelog.go +++ b/release/changelog.go @@ -7,6 +7,7 @@ import ( "fmt" "os/exec" "regexp" + "slices" "sort" "strings" @@ -269,14 +270,7 @@ func formatChangelog(commits []ConventionalCommit, version string) string { // Any remaining types not in the order list var remainingTypes []string for commitType := range grouped { - found := false - for _, t := range commitTypeOrder { - if t == commitType { - found = true - break - } - } - if !found { + if !slices.Contains(commitTypeOrder, commitType) { remainingTypes = append(remainingTypes, commitType) } }