-
Notifications
You must be signed in to change notification settings - Fork 18k
net: make errCanceled and errTimeout be "errors.Is" context.Canceled and context.DeadlineExceeded #51428
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This can be confusing but I don't see how to return One thing we can do is add an |
Another option might be to give It's not obvious to me whether that is better or worse than adding the |
Adding the |
OK, I turned this into a proposal for the behavior change. |
This proposal has been added to the active column of the proposals project |
Based on the discussion above, this proposal seems like a likely accept. |
No change in consensus, so accepted. 🎉 |
Change https://go.dev/cl/396877 mentions this issue: |
Hey guys! You're doing such an incredible work. Not only from the Language perspective, but in terms of process and participation. Going in less than a month from Proposal to Acceptance is really impressive! |
It's really awesome!!! |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
This is part of a bigger application, but here is a repo:
https://go.dev/play/p/mD-R6gerA4c
What did you expect to see?
I expect that the net.OpErr which is returned by net.dialer.DialContext included the wrapped original error, which is a context.Canceled error.
This may be the problematic function. There is also a TODO from @bradfitz
go/src/net/net.go
Lines 419 to 434 in 40e24a9
What did you see instead?
The text was updated successfully, but these errors were encountered: