Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
64559f0250 |
@@ -61,7 +61,7 @@ func (c *Client) doOnce(ctx context.Context, method, path string, body []byte) (
|
||||
if err != nil {
|
||||
return nil, 0, err
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
defer func() { _ = resp.Body.Close() }()
|
||||
b, err := io.ReadAll(resp.Body)
|
||||
return b, resp.StatusCode, err
|
||||
}
|
||||
@@ -122,7 +122,7 @@ func (c *Client) doRaw(ctx context.Context, method, path string, body []byte) (*
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
defer func() { _ = resp.Body.Close() }()
|
||||
b, err := io.ReadAll(resp.Body)
|
||||
return &rawResponse{Body: b, Status: resp.StatusCode, Headers: resp.Header}, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user