From 6bb27bcfda34c21c54bb999824469125ee534e01 Mon Sep 17 00:00:00 2001 From: mqliang Date: Wed, 25 Nov 2015 22:33:15 +0800 Subject: [PATCH] move defer statement for readability Signed-off-by: mqliang --- docs/auth.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/auth.go b/docs/auth.go index 57560935..92045c05 100644 --- a/docs/auth.go +++ b/docs/auth.go @@ -53,8 +53,8 @@ func loginV1(authConfig *cliconfig.AuthConfig, registryEndpoint *Endpoint) (stri if err != nil { return "", fmt.Errorf("Server Error: %s", err) } - reqStatusCode = req1.StatusCode defer req1.Body.Close() + reqStatusCode = req1.StatusCode reqBody, err = ioutil.ReadAll(req1.Body) if err != nil { return "", fmt.Errorf("Server Error: [%#v] %s", reqStatusCode, err)