11package gocritic
22
33import (
4+ "maps"
45 "slices"
56 "strings"
67 "testing"
@@ -9,7 +10,6 @@ import (
910 gocriticlinter "github.com/go-critic/go-critic/linter"
1011 "github.com/stretchr/testify/assert"
1112 "github.com/stretchr/testify/require"
12- "golang.org/x/exp/maps"
1313
1414 "github.com/golangci/golangci-lint/pkg/config"
1515 "github.com/golangci/golangci-lint/pkg/logutils"
@@ -40,7 +40,7 @@ func Test_settingsWrapper_InferEnabledChecks(t *testing.T) {
4040 t .Logf ("enabled by default checks:\n %s" , strings .Join (enabledByDefaultChecks , "\n " ))
4141
4242 insert := func (in []string , toInsert ... string ) []string {
43- return append ( slices .Clone (in ) , toInsert ... )
43+ return slices .Concat (in , toInsert )
4444 }
4545
4646 remove := func (in []string , toRemove ... string ) []string {
@@ -54,9 +54,7 @@ func Test_settingsWrapper_InferEnabledChecks(t *testing.T) {
5454 }
5555
5656 uniq := func (in []string ) []string {
57- result := slices .Clone (in )
58- slices .Sort (result )
59- return slices .Compact (result )
57+ return slices .Compact (slices .Sorted (slices .Values (in )))
6058 }
6159
6260 cases := []struct {
@@ -269,7 +267,7 @@ func Test_settingsWrapper_InferEnabledChecks(t *testing.T) {
269267 wr := newSettingsWrapper (tt .sett , lg )
270268
271269 wr .InferEnabledChecks ()
272- assert .ElementsMatch (t , tt .expectedEnabledChecks , maps .Keys (wr .inferredEnabledChecks ))
270+ assert .ElementsMatch (t , tt .expectedEnabledChecks , slices . Collect ( maps .Keys (wr .inferredEnabledChecks ) ))
273271 assert .NoError (t , wr .Validate ())
274272 })
275273 }
0 commit comments