Skip to content

Commit

Permalink
fix golangci-lint issue
Browse files Browse the repository at this point in the history
  • Loading branch information
shijl0925 authored Sep 6, 2024
1 parent c6d6b75 commit f3031b8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion request.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,9 @@ func (r *Requester) Do(req *http.Request, v interface{}) (*http.Response, error)
*w = strings.Trim(string(body), "\"\n")

} else {
io.CopyN(io.Discard, resp.Body, 5)
if _, err := io.CopyN(io.Discard, resp.Body, 5); err != nil {
return resp, err
}
if err := json.NewDecoder(resp.Body).Decode(&v); err != nil {
return resp, err
}
Expand Down

0 comments on commit f3031b8

Please sign in to comment.