From d0e3f1453923e5056d3d39ef73d21216f7bb88d1 Mon Sep 17 00:00:00 2001 From: Florian Schade Date: Thu, 23 Apr 2026 15:30:09 +0200 Subject: [PATCH] chore: remove loop var references --- pkg/kql/dictionary_test.go | 5 ----- pkg/kql/kql_test.go | 1 - pkg/x/path/filepathx/path_test.go | 2 -- services/activitylog/pkg/service/service_test.go | 1 - services/proxy/pkg/proxy/policy/selector_test.go | 1 - services/search/pkg/content/content_test.go | 1 - services/thumbnails/pkg/thumbnail/processor_test.go | 1 - services/thumbnails/pkg/thumbnail/storage/filesystem_test.go | 1 - services/web/pkg/assets/server_test.go | 2 -- 9 files changed, 15 deletions(-) diff --git a/pkg/kql/dictionary_test.go b/pkg/kql/dictionary_test.go index f44ba8f31d..81ace7b811 100644 --- a/pkg/kql/dictionary_test.go +++ b/pkg/kql/dictionary_test.go @@ -417,7 +417,6 @@ func TestParse_Spec(t *testing.T) { } for _, tc := range tests { - tc := tc t.Run(tc.name, func(t *testing.T) { testKQL(t, tc) }) @@ -851,7 +850,6 @@ func TestParse_DateTimeRestrictionNode(t *testing.T) { } for _, tc := range tests { - tc := tc t.Run(tc.name, func(t *testing.T) { testKQL(t, tc) }) @@ -909,7 +907,6 @@ func TestParse_Errors(t *testing.T) { } for _, tc := range tests { - tc := tc t.Run(tc.name, func(t *testing.T) { testKQL(t, tc) }) @@ -964,7 +961,6 @@ func TestParse_DottedKey(t *testing.T) { } for _, tc := range tests { - tc := tc t.Run(tc.name, func(t *testing.T) { testKQL(t, tc) }) @@ -1421,7 +1417,6 @@ func TestParse_Stress(t *testing.T) { } for _, tc := range tests { - tc := tc t.Run(tc.name, func(t *testing.T) { testKQL(t, tc) }) diff --git a/pkg/kql/kql_test.go b/pkg/kql/kql_test.go index c92d6a780a..d3b745ca3f 100644 --- a/pkg/kql/kql_test.go +++ b/pkg/kql/kql_test.go @@ -31,7 +31,6 @@ func TestNewAST(t *testing.T) { assert := tAssert.New(t) for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { got, err := kql.Builder{}.Build(tt.givenQuery) diff --git a/pkg/x/path/filepathx/path_test.go b/pkg/x/path/filepathx/path_test.go index adb773a6e0..ca8782d942 100644 --- a/pkg/x/path/filepathx/path_test.go +++ b/pkg/x/path/filepathx/path_test.go @@ -52,8 +52,6 @@ func TestJailJoin(t *testing.T) { } for _, tt := range tests { - tt := tt - t.Run(tt.name, func(t *testing.T) { t.Parallel() diff --git a/services/activitylog/pkg/service/service_test.go b/services/activitylog/pkg/service/service_test.go index 6198861040..499ef09ca3 100644 --- a/services/activitylog/pkg/service/service_test.go +++ b/services/activitylog/pkg/service/service_test.go @@ -145,7 +145,6 @@ var _ = Describe("ActivitylogService", func() { } for _, tc := range testCases { - tc := tc // capture range variable Context(tc.Name, func() { JustBeforeEach(func() { getResource = func(_ context.Context, ref *provider.Reference) (*provider.ResourceInfo, error) { diff --git a/services/proxy/pkg/proxy/policy/selector_test.go b/services/proxy/pkg/proxy/policy/selector_test.go index 5a9ca1158e..777dd0f686 100644 --- a/services/proxy/pkg/proxy/policy/selector_test.go +++ b/services/proxy/pkg/proxy/policy/selector_test.go @@ -129,7 +129,6 @@ func TestRegexSelector(t *testing.T) { } for _, tc := range tests { - tc := tc // capture range variable t.Run(tc.Name, func(t *testing.T) { r := httptest.NewRequest("GET", "https://example.com", nil) nr := r.WithContext(tc.Context) diff --git a/services/search/pkg/content/content_test.go b/services/search/pkg/content/content_test.go index 9b571a6d1c..389dcd001c 100644 --- a/services/search/pkg/content/content_test.go +++ b/services/search/pkg/content/content_test.go @@ -28,7 +28,6 @@ func TestCleanContent(t *testing.T) { } for _, tc := range tests { - tc := tc t.Run(tc.given, func(t *testing.T) { Equal(t, tc.expect, content.CleanString(tc.given, "en")) }) diff --git a/services/thumbnails/pkg/thumbnail/processor_test.go b/services/thumbnails/pkg/thumbnail/processor_test.go index 937597b011..5ab73ca33a 100644 --- a/services/thumbnails/pkg/thumbnail/processor_test.go +++ b/services/thumbnails/pkg/thumbnail/processor_test.go @@ -87,7 +87,6 @@ func TestProcessorFor(t *testing.T) { assert := tAssert.New(t) for _, tt := range tests { - tt := tt t.Run("", func(t *testing.T) { p, e := thumbnail.ProcessorFor(tt.id, tt.fileType) assert.Equal(p.ID(), tt.wantP.ID()) diff --git a/services/thumbnails/pkg/thumbnail/storage/filesystem_test.go b/services/thumbnails/pkg/thumbnail/storage/filesystem_test.go index 6770a4b9cf..d8d4a78ca5 100644 --- a/services/thumbnails/pkg/thumbnail/storage/filesystem_test.go +++ b/services/thumbnails/pkg/thumbnail/storage/filesystem_test.go @@ -56,7 +56,6 @@ func TestFileSystem_BuildKey(t *testing.T) { assert := tAssert.New(t) for _, tt := range tests { - tt := tt t.Run("", func(t *testing.T) { assert.Equal(s.BuildKey(tt.r), tt.want) }) diff --git a/services/web/pkg/assets/server_test.go b/services/web/pkg/assets/server_test.go index 4239521a8d..e60bf23014 100644 --- a/services/web/pkg/assets/server_test.go +++ b/services/web/pkg/assets/server_test.go @@ -100,8 +100,6 @@ func TestFileServer(t *testing.T) { expected: "some file content", }, } { - tt := tt - t.Run(tt.name, func(t *testing.T) { t.Parallel()