_pkg.dev: drop util/ip package

It's an unneccessary kludge, master gets its IP from config and that's it.
This commit is contained in:
Roman Khimov 2019-08-26 14:42:56 +03:00
parent 5938ebb85b
commit d7701fe7db

View file

@ -1,20 +0,0 @@
package iputils
import (
"log"
"net"
)
//GetLocalIP returns the ip address of the current node
// https://stackoverflow.com/a/37382208
func GetLocalIP() net.IP {
conn, err := net.Dial("udp", "8.8.8.8:80")
if err != nil {
log.Fatal(err)
}
defer conn.Close()
localAddr := conn.LocalAddr().(*net.UDPAddr)
return localAddr.IP
}