dev: replace sliceutil package with exp/slices ()

Co-authored-by: Fernandez Ludovic <ldez@users.noreply.github.com>
This commit is contained in:
Oleksandr Redko 2023-05-12 04:27:23 +03:00 committed by GitHub
parent aad2e22526
commit c7b50f67c9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 8 additions and 50 deletions

View file

@ -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())
}
}