mirror of
https://github.com/scratchfoundation/golangci-lint.git
synced 2025-08-06 19:39:19 -04:00
dev: replace sliceutil package with exp/slices (#3830)
Co-authored-by: Fernandez Ludovic <ldez@users.noreply.github.com>
This commit is contained in:
parent
aad2e22526
commit
c7b50f67c9
6 changed files with 8 additions and 50 deletions
|
@ -6,6 +6,8 @@ import (
|
|||
"strings"
|
||||
"testing"
|
||||
|
||||
"golang.org/x/exp/slices"
|
||||
|
||||
"github.com/golangci/golangci-lint/pkg/lint/lintersdb"
|
||||
"github.com/golangci/golangci-lint/test/testshared"
|
||||
)
|
||||
|
@ -134,16 +136,6 @@ func TestEnabledLinters(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
func inSlice(s []string, v string) bool {
|
||||
for _, sv := range s {
|
||||
if sv == v {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
func getEnabledByDefaultFastLintersExcept(except ...string) []string {
|
||||
m := lintersdb.NewManager(nil, nil)
|
||||
ebdl := m.GetAllEnabledByDefaultLinters()
|
||||
|
@ -153,7 +145,7 @@ func getEnabledByDefaultFastLintersExcept(except ...string) []string {
|
|||
continue
|
||||
}
|
||||
|
||||
if !inSlice(except, lc.Name()) {
|
||||
if !slices.Contains(except, lc.Name()) {
|
||||
ret = append(ret, lc.Name())
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue