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 {
|
||||
testcase := testcase
|
||||
t.Run(testcase.manifestRef.String(), func(t *testing.T) {
|
||||
actual, err := store.Get(testcase.listRef, testcase.manifestRef)
|
||||
if testcase.expectedErr != "" {
|
||||
assert.Error(t, err, testcase.expectedErr)
|
||||
for _, tc := range testcases {
|
||||
t.Run(tc.manifestRef.String(), func(t *testing.T) {
|
||||
actual, err := store.Get(tc.listRef, tc.manifestRef)
|
||||
if tc.expectedErr != "" {
|
||||
assert.Error(t, err, tc.expectedErr)
|
||||
assert.Check(t, IsNotFound(err))
|
||||
return
|
||||
}
|
||||
assert.NilError(t, err)
|
||||
assert.DeepEqual(t, testcase.expected, actual, cmpReferenceNamed)
|
||||
assert.DeepEqual(t, tc.expected, actual, cmpReferenceNamed)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue