TestGraphdriverPluginV2: SA5001: should check returned error before deferring (staticcheck)

```
integration/plugin/graphdriver/external_test.go:427:2: SA5001: should check returned error before deferring responseReader.Close() (staticcheck)
```

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2019-09-11 19:21:18 +02:00
parent fd65fed81b
commit 5358c95a76
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C

View file

@ -424,8 +424,8 @@ func TestGraphdriverPluginV2(t *testing.T) {
RemoteRef: plugin, RemoteRef: plugin,
AcceptAllPermissions: true, AcceptAllPermissions: true,
}) })
defer responseReader.Close()
assert.NilError(t, err) assert.NilError(t, err)
defer responseReader.Close()
// ensure it's done by waiting for EOF on the response // ensure it's done by waiting for EOF on the response
_, err = io.Copy(ioutil.Discard, responseReader) _, err = io.Copy(ioutil.Discard, responseReader)
assert.NilError(t, err) assert.NilError(t, err)