From 8b190b16dff0881e04fbc702df23ba0ff25e33c4 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Tue, 12 Nov 2024 12:50:59 +0100 Subject: [PATCH] registry: remove redundant capturing of loop vars (copyloopvar) registry/search_endpoint_v1_test.go:140:3: The copy of the 'for' variable "tc" can be deleted (Go 1.22+) (copyloopvar) tc := tc ^ registry/search_test.go:134:3: The copy of the 'for' variable "tc" can be deleted (Go 1.22+) (copyloopvar) tc := tc ^ registry/search_test.go:397:3: The copy of the 'for' variable "tc" can be deleted (Go 1.22+) (copyloopvar) tc := tc ^ Signed-off-by: Sebastiaan van Stijn --- registry/search_endpoint_v1_test.go | 1 - registry/search_test.go | 2 -- 2 files changed, 3 deletions(-) diff --git a/registry/search_endpoint_v1_test.go b/registry/search_endpoint_v1_test.go index d29fd60efc..41afcfce42 100644 --- a/registry/search_endpoint_v1_test.go +++ b/registry/search_endpoint_v1_test.go @@ -137,7 +137,6 @@ func TestV1EndpointParse(t *testing.T) { }, } for _, tc := range tests { - tc := tc t.Run(tc.address, func(t *testing.T) { ep, err := newV1EndpointFromStr(tc.address, nil, nil) if tc.expectedErr != "" { diff --git a/registry/search_test.go b/registry/search_test.go index 82b7757963..66fe2434e6 100644 --- a/registry/search_test.go +++ b/registry/search_test.go @@ -131,7 +131,6 @@ func TestSearchErrors(t *testing.T) { }, } for _, tc := range errorCases { - tc := tc t.Run(tc.expectedError, func(t *testing.T) { srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { if !tc.shouldReturnError { @@ -394,7 +393,6 @@ func TestSearch(t *testing.T) { }, } for _, tc := range successCases { - tc := tc t.Run(tc.name, func(t *testing.T) { srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-type", "application/json")