From d2d92c6f4aa0c387b7e7be6cb995a285a9b5567f Mon Sep 17 00:00:00 2001 From: Anish Bista <108048384+anishbista60@users.noreply.github.com> Date: Wed, 11 Sep 2024 14:23:34 -0500 Subject: [PATCH] Replace loopvar linter (#5976) ## Which problem is this PR solving? - Resolves #5972 ## Description of the changes - Changed the loopvar linter to copyloopvar. ## How was this change tested? - ## Checklist - [ ] I have read https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md - [ ] I have signed all commits - [ ] I have added unit tests for the new functionality - [ ] I have run lint and test steps successfully - for `jaeger`: `make lint test` - for `jaeger-ui`: `yarn lint` and `yarn test` Signed-off-by: Anish Bista --- .golangci.yml | 2 +- cmd/collector/app/handler/grpc_handler_test.go | 1 - cmd/query/app/handler_archive_test.go | 1 - 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 3f0c56026da..0b59dfa14c9 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -61,7 +61,7 @@ linters: - errorlint # Checks for pointers to enclosing loop variables. - - exportloopref + - copyloopvar - gocritic - gofmt diff --git a/cmd/collector/app/handler/grpc_handler_test.go b/cmd/collector/app/handler/grpc_handler_test.go index 61cfffef4a7..447926e0ef7 100644 --- a/cmd/collector/app/handler/grpc_handler_test.go +++ b/cmd/collector/app/handler/grpc_handler_test.go @@ -397,7 +397,6 @@ func TestBatchConsumer(t *testing.T) { logger, _ := testutils.NewLogger() for _, tc := range tests { - tc := tc t.Parallel() t.Run(tc.name, func(t *testing.T) { processor := mockSpanProcessor{} diff --git a/cmd/query/app/handler_archive_test.go b/cmd/query/app/handler_archive_test.go index 2bbb709257c..78a0afba11f 100644 --- a/cmd/query/app/handler_archive_test.go +++ b/cmd/query/app/handler_archive_test.go @@ -35,7 +35,6 @@ func TestGetArchivedTrace_NotFound(t *testing.T) { reader: mockReader, }, } { - tc := tc // capture loop var t.Run(tc.name, func(t *testing.T) { withTestServer(t, func(ts *testServer) { ts.spanReader.On("GetTrace", mock.AnythingOfType("*context.valueCtx"), mock.AnythingOfType("model.TraceID")).