Skip to content
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: comments preceding IP.String should reflect RFC 5952 conformance status #44485

Open
cameronelliott opened this issue Feb 22, 2021 · 0 comments
Open

Comments

@cameronelliott
Copy link

@cameronelliott cameronelliott commented Feb 22, 2021

What version of Go are you using (go version)?

go version go1.15.7 darwin/amd64

Does this issue reproduce with the latest release?

Y

The method in src/net/ip.go func (ip IP) String() is supposed to conform to RFC 5952 according to this comment:
#30264 (comment)

The comment is by @mikioh

But, unfortunately, the source-code comments above src/net/ip.go func (ip IP) String() do
not in any way mention that the IPv6 output is supposed to conform to RFC 5952.
RFC 5952 is "A Recommendation for IPv6 Address Text Representation"

If, indeed, -> src/net/ip.go func (ip IP) String() should conform to RFC 5952 for IPv6 addresses,
could the comments preceding the method be changed?

I would be happy to submit a PR if it is deemed:

  1. True that src/net/ip.go func (ip IP) String() does (shall) need to conform to RFC 5952
  2. The comment explaining this is useful to others.

The reason this is valuable, is some developers need to store, and then compare the ASCII representations of
IPv6 addresses.
A developer presented with the issue of needing to compare ASCII representations is then presented with the
issue of how to normalize the ASCII representation, so that systems, such as databases can use a uniform
method of representing the IPv6 addresses. This is important so that addresses which are truly equal are also
recognized when comparing the ASCII representation.
"stuff needs to work correctly, as expected when storing & comparing IPv6 addresses"

@ianlancetaylor ianlancetaylor changed the title Comments preceding src/net/ip.go func (ip IP) String() should reflect RFC 5952 conformance status net: comments preceding IP.String should reflect RFC 5952 conformance status Feb 22, 2021
@ianlancetaylor ianlancetaylor added this to the Backlog milestone Feb 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants