mirror of https://github.com/docker/cli.git
cli/manifest: Using the variable on range scope `testcase` in function literal (scopelint)
```
cli/manifest/store/store_test.go:97:29: Using the variable on range scope `testcase` in function literal (scopelint)
actual, err := store.Get(testcase.listRef, testcase.manifestRef)
^
cli/manifest/store/store_test.go:98:7: Using the variable on range scope `testcase` in function literal (scopelint)
if testcase.expectedErr != "" {
^
cli/manifest/store/store_test.go:99:26: Using the variable on range scope `testcase` in function literal (scopelint)
assert.Error(t, err, testcase.expectedErr)
^
```
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit cd3dca37b8
)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
fccc105d4d
commit
1b35214c11
|
@ -93,6 +93,7 @@ func TestStoreSaveAndGet(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, testcase := range testcases {
|
for _, testcase := range testcases {
|
||||||
|
testcase := testcase
|
||||||
t.Run(testcase.manifestRef.String(), func(t *testing.T) {
|
t.Run(testcase.manifestRef.String(), func(t *testing.T) {
|
||||||
actual, err := store.Get(testcase.listRef, testcase.manifestRef)
|
actual, err := store.Get(testcase.listRef, testcase.manifestRef)
|
||||||
if testcase.expectedErr != "" {
|
if testcase.expectedErr != "" {
|
||||||
|
|
Loading…
Reference in New Issue