mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
net: allow "" as a hint wildcard to Resolve{IP,UDP,TCP}Addr
Also fixes comments on ResolveIPAddr. Fixes #4476. R=bradfitz, golang-dev CC=golang-dev https://golang.org/cl/6854129
This commit is contained in:
parent
0304a48595
commit
e3e885bb48
6 changed files with 17 additions and 2 deletions
|
|
@ -22,6 +22,9 @@ var resolveUDPAddrTests = []struct {
|
|||
{"udp", "[::1]:1", &UDPAddr{IP: ParseIP("::1"), Port: 1}, nil},
|
||||
{"udp6", "[::1]:65534", &UDPAddr{IP: ParseIP("::1"), Port: 65534}, nil},
|
||||
|
||||
{"", "127.0.0.1:0", &UDPAddr{IP: IPv4(127, 0, 0, 1), Port: 0}, nil}, // Go 1.0 behavior
|
||||
{"", "[::1]:0", &UDPAddr{IP: ParseIP("::1"), Port: 0}, nil}, // Go 1.0 behavior
|
||||
|
||||
{"sip", "127.0.0.1:0", nil, UnknownNetworkError("sip")},
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue