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:
Sebastiaan van Stijn 2019-10-29 10:24:55 +01:00
parent 709728e723
commit fe3cc6eb7b
No known key found for this signature in database
GPG Key ID: 76698F39D527CE8C
1 changed files with 3 additions and 3 deletions

View File

@ -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")