Skip to content

Commit

Permalink
refactor: use slices.Contains
Browse files Browse the repository at this point in the history
  • Loading branch information
ldez committed Dec 29, 2024
1 parent 71e1381 commit 3cef28b
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions tagliatelle.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ func report(pass *analysis.Pass, config Base, key, convName, fieldName string, n
// This is an exception because of a bug.
// https://github.com/ldez/tagliatelle/issues/8
// For now, tagliatelle should try to remain neutral in terms of format.
if hasTagFlag(flags, "inline") {
if slices.Contains(flags, "inline") {
// skip for inline children (no name to lint)
return
}
Expand Down Expand Up @@ -231,16 +231,6 @@ func lookupTagValue(tag *ast.BasicLit, key string) (name string, flags []string,
return values[0], values[1:], true
}

func hasTagFlag(flags []string, query string) bool {
for _, flag := range flags {
if flag == query {
return true
}
}

return false
}

func createRadixTree(config Config, modPath string) *iradix.Tree[Base] {
r := iradix.New[Base]()

Expand Down

0 comments on commit 3cef28b

Please sign in to comment.