From 6a3d1e3e3e076724a92ffd589b66010afbce8c58 Mon Sep 17 00:00:00 2001 From: Hamish Hutchings Date: Sat, 3 Nov 2018 01:40:39 +0100 Subject: [PATCH] Unify the defer syntax A simple change to unify the http stream closing syntax. Signed-off-by: Hamish Hutchings --- client/container_inspect.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/container_inspect.go b/client/container_inspect.go index f453064cf8..e34bb16a26 100644 --- a/client/container_inspect.go +++ b/client/container_inspect.go @@ -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 }