From 23922f4d08528cb3a54e1ba53bbe0414ab1a46d3 Mon Sep 17 00:00:00 2001 From: Robert Gogolok Date: Tue, 3 Dec 2024 00:06:36 +0100 Subject: [PATCH 1/2] exportloopref: deprecation Signed-off-by: Robert Gogolok --- golangci.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 From 32f1113b2870f0eb1d95dd54cff1734f4f647d58 Mon Sep 17 00:00:00 2001 From: Robert Gogolok Date: Tue, 3 Dec 2024 00:06:57 +0100 Subject: [PATCH 2/2] copyloopvar: Fix linter errors Signed-off-by: Robert Gogolok --- internal/name/ref_test.go | 1 - phase/extender_test.go | 3 --- phase/generator_test.go | 3 --- 3 files changed, 7 deletions(-) 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 {