Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
net: Resolve*([::]) gives IPv4 zero, not IPv6 #20911
https://go-review.googlesource.com/45088 changed the behavior such that ResolveUDPAddr("[::]") followed by DialUDP on the result dials IPv4 localhost, not IPv6 localhost, which then fails when IPv4 is not configured. This is because ResolveUDPAddr unconditionally prefers IPv4 addresses when they're present in the addrList returned by internetAddrList. Looking at the code, I expect ResolveTCPAddr will have the same problem.
Thanks for finding that. That's certainly not documented at https://golang.org/pkg/net/#ResolveUDPAddr
This is causing breakages somewhere I assume?