diff --git a/pkg/golinters/gocritic/gocritic_test.go b/pkg/golinters/gocritic/gocritic_test.go index ae6f3b01e9b9..57c132513aba 100644 --- a/pkg/golinters/gocritic/gocritic_test.go +++ b/pkg/golinters/gocritic/gocritic_test.go @@ -40,7 +40,7 @@ func Test_settingsWrapper_InferEnabledChecks(t *testing.T) { t.Logf("enabled by default checks:\n%s", strings.Join(enabledByDefaultChecks, "\n")) insert := func(in []string, toInsert ...string) []string { - return append(slices.Clone(in), toInsert...) + return slices.Concat(in, toInsert) } remove := func(in []string, toRemove ...string) []string { diff --git a/pkg/lint/lintersdb/validator_test.go b/pkg/lint/lintersdb/validator_test.go index 25e77e4490b0..167cdeeb5070 100644 --- a/pkg/lint/lintersdb/validator_test.go +++ b/pkg/lint/lintersdb/validator_test.go @@ -1,6 +1,7 @@ package lintersdb import ( + "slices" "testing" "github.com/stretchr/testify/require" @@ -113,9 +114,7 @@ func TestValidator_Validate(t *testing.T) { v := NewValidator(m) - var testCases []validatorTestCase - testCases = append(testCases, validateLintersNamesTestCases...) - testCases = append(testCases, validatePresetsTestCases...) + testCases := slices.Concat(validateLintersNamesTestCases, validatePresetsTestCases) for _, test := range testCases { t.Run(test.desc, func(t *testing.T) { @@ -133,9 +132,7 @@ func TestValidator_Validate_error(t *testing.T) { v := NewValidator(m) - var testCases []validateErrorTestCase - testCases = append(testCases, validateLintersNamesErrorTestCases...) - testCases = append(testCases, validatePresetsErrorTestCases...) + testCases := slices.Concat(validateLintersNamesErrorTestCases, validatePresetsErrorTestCases) for _, test := range testCases { t.Run(test.desc, func(t *testing.T) {