chore: update linter
This commit is contained in:
parent
1034646ae2
commit
88a2020817
57 changed files with 139 additions and 218 deletions
|
@ -3,6 +3,7 @@ package constraints
|
|||
import (
|
||||
"errors"
|
||||
"regexp"
|
||||
"slices"
|
||||
|
||||
"github.com/vulcand/predicate"
|
||||
)
|
||||
|
@ -47,12 +48,7 @@ func MatchTags(tags []string, expr string) (bool, error) {
|
|||
|
||||
func tagFn(name string) constraintTagFunc {
|
||||
return func(tags []string) bool {
|
||||
for _, tag := range tags {
|
||||
if tag == name {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
return slices.Contains(tags, name)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -63,13 +59,9 @@ func tagRegexFn(expr string) constraintTagFunc {
|
|||
return false
|
||||
}
|
||||
|
||||
for _, tag := range tags {
|
||||
if exp.MatchString(tag) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
return false
|
||||
return slices.ContainsFunc(tags, func(tag string) bool {
|
||||
return exp.MatchString(tag)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue