Skip to content

Commit 6e07d2b

Browse files
authored
fix: use slices.Contains instead of for loop (#410)
Signed-off-by: Chris Gianelloni <[email protected]>
1 parent 06c121d commit 6e07d2b

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

pkgmgr/package.go

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import (
2828
"path/filepath"
2929
"regexp"
3030
"runtime"
31+
"slices"
3132
"strings"
3233

3334
"github.com/hashicorp/go-version"
@@ -98,13 +99,7 @@ func (p Package) defaultOpts() map[string]bool {
9899

99100
func (p Package) hasTags(tags []string) bool {
100101
for _, tag := range tags {
101-
foundTag := false
102-
for _, pkgTag := range p.Tags {
103-
if tag == pkgTag {
104-
foundTag = true
105-
break
106-
}
107-
}
102+
foundTag := slices.Contains(p.Tags, tag)
108103
if !foundTag {
109104
return false
110105
}

0 commit comments

Comments
 (0)