mirror of https://github.com/docker/cli.git
cli/manifest: remove redundant capturing of loop vars in tests (copyloopvar)
go1.22 and up now produce a unique variable in loops, tehrefore no longer requiring to capture the variable manually; service/logs/parse_logs_test.go:50: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:
parent
6489a777e5
commit
bf37e26b33
|
@ -81,17 +81,16 @@ func TestStoreSaveAndGet(t *testing.T) {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, testcase := range testcases {
|
for _, tc := range testcases {
|
||||||
testcase := testcase
|
t.Run(tc.manifestRef.String(), func(t *testing.T) {
|
||||||
t.Run(testcase.manifestRef.String(), func(t *testing.T) {
|
actual, err := store.Get(tc.listRef, tc.manifestRef)
|
||||||
actual, err := store.Get(testcase.listRef, testcase.manifestRef)
|
if tc.expectedErr != "" {
|
||||||
if testcase.expectedErr != "" {
|
assert.Error(t, err, tc.expectedErr)
|
||||||
assert.Error(t, err, testcase.expectedErr)
|
|
||||||
assert.Check(t, IsNotFound(err))
|
assert.Check(t, IsNotFound(err))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
assert.NilError(t, err)
|
assert.NilError(t, err)
|
||||||
assert.DeepEqual(t, testcase.expected, actual, cmpReferenceNamed)
|
assert.DeepEqual(t, tc.expected, actual, cmpReferenceNamed)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue