diff --git a/.golangci.yml b/.golangci.yml index 2f6c810..ff70ada 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -37,6 +37,7 @@ linters: - tparallel - paralleltest - predeclared + - modernize # disable noisy/controversial ones which you might enable later disable: diff --git a/it/map.go b/it/map.go index 166af55..9badaa9 100644 --- a/it/map.go +++ b/it/map.go @@ -143,7 +143,7 @@ func Assign[K comparable, V any, Map ~map[K]V](maps ...iter.Seq[Map]) Map { for i := range maps { for item := range maps[i] { for k, v := range item { - out[k] = v + out[k] = v //nolint:modernize } } } diff --git a/it/seq_test.go b/it/seq_test.go index 0a3281c..5b19e8d 100644 --- a/it/seq_test.go +++ b/it/seq_test.go @@ -730,7 +730,7 @@ func TestInterleave(t *testing.T) { }, } for _, tc := range testCases { - tc := tc + tc := tc //nolint:modernize t.Run(tc.name, func(t *testing.T) { t.Parallel() assert.Equal(t, tc.want, slices.Collect(Interleave(tc.in...))) @@ -852,7 +852,7 @@ func TestAssociate(t *testing.T) { }, } for i, tc := range testCases { - tc := tc + tc := tc //nolint:modernize t.Run(fmt.Sprintf("test_%d", i), func(t *testing.T) { t.Parallel() assert.Equal(t, tc.want, Associate(slices.Values(tc.in), transform)) @@ -884,7 +884,7 @@ func TestAssociateI(t *testing.T) { }, } for i, tc := range testCases { - tc := tc + tc := tc //nolint:modernize t.Run(fmt.Sprintf("test_%d", i), func(t *testing.T) { t.Parallel() assert.Equal(t, tc.want, AssociateI(slices.Values(tc.in), transform)) @@ -920,7 +920,7 @@ func TestSeqToMap(t *testing.T) { }, } for i, tc := range testCases { - tc := tc + tc := tc //nolint:modernize t.Run(fmt.Sprintf("test_%d", i), func(t *testing.T) { t.Parallel() assert.Equal(t, tc.want, SeqToMap(slices.Values(tc.in), transform)) @@ -952,7 +952,7 @@ func TestSeqToMapI(t *testing.T) { }, } for i, tc := range testCases { - tc := tc + tc := tc //nolint:modernize t.Run(fmt.Sprintf("test_%d", i), func(t *testing.T) { t.Parallel() assert.Equal(t, tc.want, SeqToMapI(slices.Values(tc.in), transform)) @@ -988,7 +988,7 @@ func TestFilterSeqToMap(t *testing.T) { }, } for i, tc := range testCases { - tc := tc + tc := tc //nolint:modernize t.Run(fmt.Sprintf("test_%d", i), func(t *testing.T) { t.Parallel() assert.Equal(t, tc.want, FilterSeqToMap(slices.Values(tc.in), transform)) @@ -1020,7 +1020,7 @@ func TestFilterSeqToMapI(t *testing.T) { }, } for i, tc := range testCases { - tc := tc + tc := tc //nolint:modernize t.Run(fmt.Sprintf("test_%d", i), func(t *testing.T) { t.Parallel() assert.Equal(t, tc.want, FilterSeqToMapI(slices.Values(tc.in), transform)) diff --git a/math_test.go b/math_test.go index 77c3bec..6a420c7 100644 --- a/math_test.go +++ b/math_test.go @@ -241,8 +241,8 @@ func TestProductByErr(t *testing.T) { // Test normal operation (no error) - table driven tests := []struct { name string - input interface{} - expected interface{} + input any + expected any }{ { name: "float32 slice", @@ -403,8 +403,8 @@ func TestMeanByErr(t *testing.T) { // Test normal operation (no error) - table driven tests := []struct { name string - input interface{} - expected interface{} + input any + expected any }{ { name: "float32 slice",