mirror of https://github.com/docker/cli.git
cli/context/store: SA5001: should check returned error before deferring f.Close() (staticcheck)
``` cli/context/store/store_test.go:156:2: SA5001: should check returned error before deferring f.Close() (staticcheck) defer f.Close() ^ cli/context/store/store_test.go:189:2: SA5001: should check returned error before deferring f.Close() (staticcheck) defer f.Close() ^ cli/context/store/store_test.go:240:2: SA5001: should check returned error before deferring f.Close() (staticcheck) defer f.Close() ^ ``` Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
709728e723
commit
fe3cc6eb7b
|
@ -153,8 +153,8 @@ func TestImportTarInvalid(t *testing.T) {
|
|||
tf := path.Join(testDir, "test.context")
|
||||
|
||||
f, err := os.Create(tf)
|
||||
defer f.Close()
|
||||
assert.NilError(t, err)
|
||||
defer f.Close()
|
||||
|
||||
tw := tar.NewWriter(f)
|
||||
hdr := &tar.Header{
|
||||
|
@ -186,8 +186,8 @@ func TestImportZip(t *testing.T) {
|
|||
zf := path.Join(testDir, "test.zip")
|
||||
|
||||
f, err := os.Create(zf)
|
||||
defer f.Close()
|
||||
assert.NilError(t, err)
|
||||
defer f.Close()
|
||||
w := zip.NewWriter(f)
|
||||
|
||||
meta, err := json.Marshal(Metadata{
|
||||
|
@ -237,8 +237,8 @@ func TestImportZipInvalid(t *testing.T) {
|
|||
zf := path.Join(testDir, "test.zip")
|
||||
|
||||
f, err := os.Create(zf)
|
||||
defer f.Close()
|
||||
assert.NilError(t, err)
|
||||
defer f.Close()
|
||||
w := zip.NewWriter(f)
|
||||
|
||||
df, err := w.Create("dummy-file")
|
||||
|
|
Loading…
Reference in New Issue