code: func getIPFromInterface(intfName string, forFamily AddressFamily, nw networkInterfacer) (net.IP, error) {
  	intf, err := nw.InterfaceByName(intfName)
  	if err != nil {
  		return nil, err
  	}
  	if isInterfaceUp(intf) {
  		addrs, err := nw.Addrs(intf)
  		if err != nil {
  			return nil, err
  		}
  		klog.V(4).Infof("Interface %q has %d addresses :%v.", intfName, len(addrs), addrs)
  		matchingIP, err := getMatchingGlobalIP(addrs, forFamily)
  		if err != nil {
  			return nil, err
  		}
  		if matchingIP != nil {
  			klog.V(4).Infof("Found valid IPv%d address %v for interface %q.", int(forFamily), matchingIP, intfName)
  			return matchingIP, nil
  		}
  	}
  	return nil, nil
  }
docs: // getIPFromInterface gets the IPs on an interface and returns a global unicast address, if any. The
  // interface must be up, the IP must in the family requested, and the IP must be a global unicast address.