-
Notifications
You must be signed in to change notification settings - Fork 18k
net/url: URL should implement UnmarshalText, not just UnmarshalBinary #25705
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
Have you had a look at the source code?
In particular, read the commit that added this code - 6595709. It seems like adding what you suggest would break existing code. Perhaps this can be left for Go2, or for any other opportunity where backwards compatibility can be broken in this package. |
Duplicate #10275 |
Thanks, @bontibon. It indeed makes sense to group all of these under one umbrella issue for Go2. |
Why? I don't understand.
Only implementing UnmarshalText wouldn't change the JSON representation of URLs. What is wrong with only implementing the parsing portion? |
The URL struct of net/url only implements UnmarshalBinary.
I think that it should also implement UnmarshalText (it would be the same code)
There are parsers that depend on this.
net/url UnmarshalBinary's signature even names the []byte argument "text":
The text was updated successfully, but these errors were encountered: