net/http: Do(): url.Error value's Timeout is false if request canceled #33545
Comments
Change https://golang.org/cl/200798 mentions this issue: |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
What did you do?
Run the following: https://play.golang.org/p/jjlki46yvxi
What did you expect to see?
According to the docs of
func (*Client) Do
, I expect that "The url.Error value's Timeout method will report true if request timed out or was canceled."What did you see instead?
The url.Error value's Timeout method reports false if request was canceled.
Additional notes
In contrast, if you run https://play.golang.org/p/xdNeyWl3Zc7, as the docs correctly state, the url.Error value's Timeout method reports true if request timed out.
The doc change got introduced in 6df4c3a.
The same documentation
also exists for
func (*Client) Get
andfunc Get
.Maybe the documentation refers to canceling a request via
func (*Transport) CancelRequest
?However, since
CancelRequest
is deprecated, I would delete the partor was canceled
from the docs offunc (*Client) Do
.System details
The text was updated successfully, but these errors were encountered: