From 12af604cf208d3105ced825c65231b4ecf00a8cc Mon Sep 17 00:00:00 2001 From: Louis DeLosSantos Date: Mon, 28 Jan 2019 03:53:16 -0500 Subject: [PATCH] wait for done before writing to shared resp body (#532) Signed-off-by: Louis Delossantos --- api/client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/client.go b/api/client.go index 09af749..9d5b187 100644 --- a/api/client.go +++ b/api/client.go @@ -119,8 +119,8 @@ func (c *httpClient) Do(ctx context.Context, req *http.Request) (*http.Response, select { case <-ctx.Done(): - err = resp.Body.Close() <-done + err = resp.Body.Close() if err == nil { err = ctx.Err() }