net/url: should *User methods return zero values when called with a nil receiver? #20924
Labels
FrozenDueToAge
NeedsDecision
Feedback is required from experts, contributors, and/or the community before a change can be made.
release-blocker
Milestone
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?What operating system and processor architecture are you using (
go env
)?What did you do?
https://play.golang.org/p/3yO2OL-XTq
What did you expect to see?
I would like to have something like
username, err := url.User.Username()
and handle the error if there is no username in the url.What did you see instead?
A panic.
The text was updated successfully, but these errors were encountered: