Unify the defer syntax

A simple change to unify the http stream closing syntax.

Signed-off-by: Hamish Hutchings <hamish@aoeu.me>
This commit is contained in:
Hamish Hutchings 2018-11-03 01:40:39 +01:00
parent ad1354ffb4
commit 6a3d1e3e3e
No known key found for this signature in database
GPG Key ID: 80784F5CAD59A3F4
1 changed files with 1 additions and 1 deletions

View File

@ -19,10 +19,10 @@ func (cli *Client) ContainerInspect(ctx context.Context, containerID string) (ty
if err != nil {
return types.ContainerJSON{}, wrapResponseError(err, serverResp, "container", containerID)
}
defer ensureReaderClosed(serverResp)
var response types.ContainerJSON
err = json.NewDecoder(serverResp.body).Decode(&response)
ensureReaderClosed(serverResp)
return response, err
}