9ad4cf1db9
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
14 lines
202 B
Go
14 lines
202 B
Go
package utils
|
|
|
|
import "net"
|
|
|
|
func GetIP(addr net.Addr) string {
|
|
switch addr := addr.(type) {
|
|
case *net.UDPAddr:
|
|
return addr.IP.String()
|
|
case *net.TCPAddr:
|
|
return addr.IP.String()
|
|
}
|
|
return ""
|
|
}
|