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 <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn
2024-11-12 12:50:59 +01:00
parent 21e1038d12
commit 8b190b16df
2 changed files with 0 additions and 3 deletions

View File

@@ -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 != "" {

View File

@@ -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")