Skip to content

Commit

Permalink
Fix shadowed error in webseed response handling
Browse files Browse the repository at this point in the history
  • Loading branch information
anacrolix committed Jun 30, 2024
1 parent 4da2fbf commit f22cf7d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions webseed/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,10 +176,11 @@ var ErrTooFast = errors.New("making requests too fast")
func readRequestPartResponses(ctx context.Context, parts []requestPart) (_ []byte, err error) {
var buf bytes.Buffer
for _, part := range parts {
result, err := part.do()
var resp *http.Response
resp, err = part.do()

if err == nil {
err = recvPartResult(ctx, &buf, part, result)
err = recvPartResult(ctx, &buf, part, resp)
}

if err != nil {
Expand Down

0 comments on commit f22cf7d

Please sign in to comment.