1
0
mirror of https://github.com/go-kratos/kratos.git synced 2025-01-14 02:33:03 +02:00

fix client do method done not use when err not nil (#1948)

This commit is contained in:
李洛克 2022-04-25 15:10:19 +08:00 committed by GitHub
parent ae230eb550
commit 4472cdbf49
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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
}