Clarify code in HTTPUClient.Do.

The previous code was misleading by returning the `err` variable rather than an explicit `nil`. This code path was actually the success path. Functionally it was correct as that specific scoping of `err` could only be `nil` if that line of code was reached.
This commit is contained in:
Huin 2018-04-15 22:51:57 +01:00 committed by GitHub
parent 167b9766e5
commit 1395d14473
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -128,5 +128,7 @@ func (httpu *HTTPUClient) Do(req *http.Request, timeout time.Duration, numSends
responses = append(responses, response) responses = append(responses, response)
} }
return responses, err
// Timeout reached - return discovered responses.
return responses, nil
} }