net: JoinHostPort() enclose IPv6 in square brackets even if host is already in this format #20470
Labels
Comments
Your input is invalid. JoinHostPort expects a host name, which does include square brackets. The square brackets are only valid when joined with a port. |
Note that JoinHostPort doesn't do any sanitization of your host (e.g. https://play.golang.org/p/cbnk8RrQNy). The existing docs say exactly what it does:
I'm not sure there's anything to do here. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
What version of Go are you using (
go version
)?go version go1.8.1 darwin/amd64
What operating system and processor architecture are you using (
go env
)?What did you do?
https://play.golang.org/p/nrIZqsxHIY
What did you expect to see?
[[fd41:9eff:c33::1b:ffff]]:5672
What did you see instead?
[fd41:9eff:c33::1b:ffff]:5672
The text was updated successfully, but these errors were encountered: