Explorar o código

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>
Sebastiaan van Stijn %!s(int64=5) %!d(string=hai) anos
pai
achega
5358c95a76
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      integration/plugin/graphdriver/external_test.go

+ 1 - 1
integration/plugin/graphdriver/external_test.go

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