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
net: OpError(nil).Unwrap() crashes, while .Error() doesn't #36368
Comments
In my opinion, Both the unexported |
I would mark it WAI. |
Awesome, thank you @jba for the resolution. @rski, thank you again for filing this bug, but it is working as intended, please don’t hesitate however to file more or to ask questions at any of these resources https://github.com/golang/go/wiki/Questions. |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
yes, with go1.13.5
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
As the summary says, this can be verified by code inspection:
and this is the rerpo:
What did you expect to see?
No crash? Unwrap returning nil? I'm not exactly sure what the right behaviour would be here. I'm in favour of just returning nil, since .Error() has set the precedent and a nil is not wrapping anything. Obviously it's not great to have a typed nil floating about. nor would I want to depend on this behaviour, this is more for consistency's sake.
What did you see instead?
The text was updated successfully, but these errors were encountered: