util.AddrIP, TCPAddr
This commit is contained in:
parent
1663a8a2f5
commit
0c7c2e1955
|
@ -27,6 +27,8 @@ func AddrIP(addr net.Addr) net.IP {
|
|||
switch raw := addr.(type) {
|
||||
case *net.UDPAddr:
|
||||
return raw.IP
|
||||
case *net.TCPAddr:
|
||||
return raw.IP
|
||||
default:
|
||||
host, _, err := net.SplitHostPort(addr.String())
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in New Issue