net.go
func RealNetIP() string {
	addrs, err := net.InterfaceAddrs()

	if err != nil {
		fmt.Println(err)
		return ""
	}

	// get real local IP
	for _, address := range addrs {
		if ipnet, ok := address.(*net.IPNet); ok && !ipnet.IP.IsLoopback() {
			if ipnet.IP.To4() != nil {
				return ipnet.IP.String()
			}

		}
	}
	return ""
}
func RealNetIP() string {
	addrs, err := net.InterfaceAddrs()

	if err != nil {
		fmt.Println(err)
		return ""
	}

	// get real local IP
	for _, address := range addrs {
		if ipnet, ok := address.(*net.IPNet); ok && !ipnet.IP.IsLoopback() {
			if ipnet.IP.To4() != nil {
				return ipnet.IP.String()
			}

		}
	}
	return ""
}
func RealNetIP ( ) string { addrs , err := net . InterfaceAddrs ( ) if err != nil { fmt . Println ( err ) return " " } // get real local IP for _ , address := range addrs { if ipnet , ok := address . ( * net . IPNet ) ; ok && ! ipnet . IP . IsLoopback ( ) { if ipnet . IP . To4 ( ) != nil { return ipnet . IP . String ( ) } } } return " " }
// RealNetIP returns the real local IP of the system or an empty string.
RealNetIP returns the real local IP of the system or an empty string .