code: func defaultIP(addr *net.TCPAddr) string {
  	if !addr.IP.IsUnspecified() {
  		return addr.IP.String()
  	}
  
  	nics, err := net.Interfaces()
  	if err != nil {
  		return addr.IP.String()
  	}
  
  	for _, nic := range nics {
  		if nic.Name == "docker0" || strings.HasPrefix(nic.Name, "vmnet") {
  			continue
  		}
  		addrs, aerr := nic.Addrs()
  		if aerr != nil {
  			continue
  		}
  		for _, addr := range addrs {
  			if ip, ok := addr.(*net.IPNet); ok && !ip.IP.IsLoopback() {
  				if ip.IP.To4() != nil {
  					return ip.IP.String()
  				}
  			}
  		}
  	}
  
  	return addr.IP.String()
  }
docs: // defaultIP returns addr.IP if specified, otherwise attempts to find a non-loopback ipv4 IP