code: func ChooseHostInterface() (net.IP, error) {
  	var nw networkInterfacer = networkInterface{}
  	if _, err := os.Stat(ipv4RouteFile); os.IsNotExist(err) {
  		return chooseIPFromHostInterfaces(nw)
  	}
  	routes, err := getAllDefaultRoutes()
  	if err != nil {
  		return nil, err
  	}
  	return chooseHostInterfaceFromRoute(routes, nw)
  }
docs: // ChooseHostInterface is a method used fetch an IP for a daemon.
  // If there is no routing info file, it will choose a global IP from the system
  // interfaces. Otherwise, it will use IPv4 and IPv6 route information to return the
  // IP of the interface with a gateway on it (with priority given to IPv4). For a node
  // with no internet connection, it returns error.