Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
net: ResolveIPAddr cannot parse an IPv6 address enclosed in square brackets #3837
What steps will reproduce the problem? 1. call ResolveIPAddr("ip", "[::1]") 2. 3. What is the expected output? What do you see instead? No error return but got an error ``[::1]: no such host''. Please use labels and text to provide additional information. ResolveIPAddr("ip", "::1") works well, oops.
Russ said at golang-dev: -- NOT LGTM [::] is no more an IP address than 127.0.0.1:. The syntax for adding a port to an IPv6 address is [addr]:port, but the  are not part of the addr. In addition to being consistent with the RFCs, this appears to be consistent with other Unix programs. For example, on my Mac: $ telnet '[::1]' [::1]: nodename nor servname provided, or not known $ telnet ::1 Trying ::1... telnet: connect to address ::1: Connection refused telnet: Unable to connect to remote host $ -- Makes sense.
Status changed to WorkingAsIntended.
This issue was closed.