1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

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

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
}