Skip to content

Commit e359636

Browse files
committed
pkg/linter,internal/util: nitpicks
Signed-off-by: Stephan Renatus <[email protected]>
1 parent 218d136 commit e359636

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

internal/util/util.go

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"fmt"
55
"os"
66
"path/filepath"
7+
"slices"
78
"strings"
89
)
910

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

2324
// Contains checks if slice contains element.
2425
func Contains[T comparable](s []T, e T) bool {
25-
for _, v := range s {
26-
if v == e {
27-
return true
28-
}
29-
}
30-
31-
return false
26+
return slices.Contains(s, e)
3227
}
3328

3429
// NullToEmpty returns empty slice if provided slice is nil.

pkg/linter/linter.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,7 @@ func (l Linter) paramsToRulesConfig() map[string]any {
587587
params["ignore_files"] = l.ignoreFiles
588588
}
589589

590-
return map[string]interface{}{
590+
return map[string]any{
591591
"eval": map[string]any{
592592
"params": params,
593593
},

0 commit comments

Comments
 (0)