Skip to content

Commit

Permalink
pkg/linter,internal/util: nitpicks
Browse files Browse the repository at this point in the history
Signed-off-by: Stephan Renatus <[email protected]>
  • Loading branch information
srenatus committed Oct 2, 2024
1 parent 218d136 commit e359636
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
9 changes: 2 additions & 7 deletions internal/util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"fmt"
"os"
"path/filepath"
"slices"
"strings"
)

Expand All @@ -22,13 +23,7 @@ func Keys[K comparable, V any](m map[K]V) []K {

// Contains checks if slice contains element.
func Contains[T comparable](s []T, e T) bool {
for _, v := range s {
if v == e {
return true
}
}

return false
return slices.Contains(s, e)
}

// NullToEmpty returns empty slice if provided slice is nil.
Expand Down
2 changes: 1 addition & 1 deletion pkg/linter/linter.go
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ func (l Linter) paramsToRulesConfig() map[string]any {
params["ignore_files"] = l.ignoreFiles
}

return map[string]interface{}{
return map[string]any{
"eval": map[string]any{
"params": params,
},
Expand Down

0 comments on commit e359636

Please sign in to comment.