diff --git a/golangci.yaml b/golangci.yaml index a428e7020..cf89ad356 100644 --- a/golangci.yaml +++ b/golangci.yaml @@ -5,15 +5,16 @@ linters: disable-all: true enable: - bodyclose + - copyloopvar - dogsled - errcheck - - exportloopref - gocritic - goimports - gosec - gosimple - govet - ineffassign + - intrange - misspell - nakedret - revive diff --git a/internal/name/ref_test.go b/internal/name/ref_test.go index 73c3dd997..5f7a37243 100644 --- a/internal/name/ref_test.go +++ b/internal/name/ref_test.go @@ -73,7 +73,6 @@ func testRef(t *testing.T, when spec.G, it spec.S) { }, } for _, tc := range testCases { - tc := tc w := when w(tc.condition, func() { it(tc.does, func() { diff --git a/phase/extender_test.go b/phase/extender_test.go index 7dc8eec25..186e04eea 100644 --- a/phase/extender_test.go +++ b/phase/extender_test.go @@ -247,8 +247,6 @@ func testExtender(t *testing.T, when spec.G, it spec.S) { api.MustParse("0.12"), api.MustParse("0.13"), } { - platformAPI := platformAPI - when(fmt.Sprintf("using the platform API %s", platformAPI), func() { it.Before(func() { extender.PlatformAPI = platformAPI @@ -379,7 +377,6 @@ func testExtender(t *testing.T, when spec.G, it spec.S) { expectedImageSHA: notRebasableSHA, }, } { - tc := tc when := when desc := func(b bool) string { if b { diff --git a/phase/generator_test.go b/phase/generator_test.go index df7ecb980..e01bb24bb 100644 --- a/phase/generator_test.go +++ b/phase/generator_test.go @@ -179,8 +179,6 @@ func testGenerator(t *testing.T, when spec.G, it spec.S) { api.MustParse("0.12"), api.MustParse("0.13"), } { - platformAPI := platformAPI - when(fmt.Sprintf("using the platform API %s", platformAPI), func() { it.Before(func() { generator.PlatformAPI = platformAPI @@ -586,7 +584,6 @@ func testGenerator(t *testing.T, when spec.G, it spec.S) { }, }, } { - tc := tc when := when when(tc.descCondition, func() { if tc.before != nil {