From 11273fc9a631a10a65fdcab0d188b679fbbbfd74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E6=B4=9B=E5=85=8B?= <759876426@qq.com> Date: Mon, 25 Apr 2022 15:10:19 +0800 Subject: [PATCH] fix client do method done not use when err not nil (#1948) --- transport/http/client.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/transport/http/client.go b/transport/http/client.go index 55719eb9e..2ae29ffb2 100644 --- a/transport/http/client.go +++ b/transport/http/client.go @@ -289,13 +289,12 @@ func (client *Client) do(req *http.Request) (*http.Response, error) { if err == nil { err = client.opts.errorDecoder(req.Context(), resp) } - - if err != nil { - return nil, err - } if done != nil { done(req.Context(), selector.DoneInfo{Err: err}) } + if err != nil { + return nil, err + } return resp, nil }