mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
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:
@@ -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 != "" {
|
||||
|
||||
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user