From 1395d1447324cbea88d249fbfcfd70ea878fdfca Mon Sep 17 00:00:00 2001 From: Huin Date: Sun, 15 Apr 2018 22:51:57 +0100 Subject: [PATCH] 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. --- httpu/httpu.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/httpu/httpu.go b/httpu/httpu.go index 919589c..44b0c58 100644 --- a/httpu/httpu.go +++ b/httpu/httpu.go @@ -128,5 +128,7 @@ func (httpu *HTTPUClient) Do(req *http.Request, timeout time.Duration, numSends responses = append(responses, response) } - return responses, err + + // Timeout reached - return discovered responses. + return responses, nil }