net/http: Do(): url.Error value's Timeout is false if request canceled #33545
Labels
Documentation
FrozenDueToAge
NeedsFix
The path to resolution is known, but the work has not been done.
Milestone
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: