-
Notifications
You must be signed in to change notification settings - Fork 18k
net: net.ParseIP always return ipv6 #65131
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 is intentional, Lines 27 to 36 in 8e658ee
EDIT: but maybe it should be documented better? |
Oh yes, this should be documented better! 🩹 🤕 I've been bitten in the past on this, more so, when combining with 3rd party modules. I'm basically now having always code in place that converts back to the IPv4 4-octets representation upon detecting this situation, using this as my canonical IPv4 representation anywhere, especially before comparing type |
Change https://go.dev/cl/598076 mentions this issue: |
Go version
go version go1.21.3 windows/amd64
Output of
go env
in your module/workspace:What did you do?
What did you see happen?
[0 0 0 0 0 0 0 0 0 0 255 255 127 0 0 1]
false
[192 168 0 111]
What did you expect to see?
[127 0 0 1]
false
[192 168 0 111]
The text was updated successfully, but these errors were encountered: