浏览代码

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 5 年之前
父节点
当前提交
5358c95a76
共有 1 个文件被更改,包括 1 次插入1 次删除
  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)