code: func findNetwork(iface *net.Interface, ip net.IP) (*net.IPNet, error) {
  	addrs, err := iface.Addrs()
  	if err != nil {
  		return nil, fmt.Errorf("Failed to get addresses for interface %q: %v", iface.Name, err)
  	}
  	for _, addr := range addrs {
  		ipStr := addr.String()
  		ipAddr, ipNet, err := net.ParseCIDR(ipStr)
  		if err != nil {
  			return nil, fmt.Errorf("Failed to parse interface address %q - %v: %v", iface.Name, ipStr, err)
  		}
  		if ipAddr.Equal(ip) {
  			return ipNet, nil
  		}
  	}
  	return nil, fmt.Errorf("Failed to find IP %v on interface %q", ip, iface.Name)
  }
docs: // findNetwork returns the network for the given IP address on the given
  // interface. If the address is not configured on the interface, an error is
  // returned.