From f1022f43e3f49acf5a2ee7a239aab7f74308c2d1 Mon Sep 17 00:00:00 2001 From: Marc Sauter Date: Mon, 5 Nov 2018 09:40:57 +0100 Subject: [PATCH] return response if client.Do fails --- httpclient.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/httpclient.go b/httpclient.go index 50faf54..1c2ce3a 100644 --- a/httpclient.go +++ b/httpclient.go @@ -289,7 +289,7 @@ func (c *Client) Do(ctx context.Context, req *http.Request, v interface{}) (*htt resp, err := c.client.Do(req.WithContext(ctx)) if err != nil { - return nil, err + return resp, err } defer func() {