func (a MachineAddress) ValueWithMask() (string, error) {
	// Returning a NotFound error preserves prior behaviour from when
	// CIDRAddress was a method on InterfaceInfo.
	// TODO (manadart 2021-03-16): Rethink this as we clean up InterfaceInfos
	// and its corresponding wire type.
	if a.Value == "" || a.CIDR == "" {
		return "", errors.NotFoundf("address and CIDR pair (%q, %q)", a.Value, a.CIDR)
	}

	_, ipNet, err := net.ParseCIDR(a.CIDR)
	if err != nil {
		return "", errors.Trace(err)
	}

	ip := a.IP()
	if ip == nil {
		return "", errors.Errorf("cannot parse IP address %q", a.Value)
	}

	ipNet.IP = ip
	return ipNet.String(), nil
}
// ValueWithMask returns the value of the address combined
// with the subnet mask indicated by its CIDR.
ValueWithMask returns the value of the address combined
with the subnet mask indicated by its CIDR.
// ValueWithMask returns the value of the address combined // with the subnet mask indicated by its CIDR .
func (a MachineAddress) ValueWithMask() (string, error) {
	if a.Value == "" || a.CIDR == "" {
		return "", errors.NotFoundf("address and CIDR pair (%q, %q)", a.Value, a.CIDR)
	}
	_, ipNet, err := net.ParseCIDR(a.CIDR)
	if err != nil {
		return "", errors.Trace(err)
	}
	ip := a.IP()
	if ip == nil {
		return "", errors.Errorf("cannot parse IP address %q", a.Value)
	}
	ipNet.IP = ip
	return ipNet.String(), nil
}
func ( a MachineAddress ) ValueWithMask ( ) ( string , error ) { if a . Value == " " || a . CIDR == " " { return " " , errors . NotFoundf ( " " , a . Value , a . CIDR ) } _ , ipNet , err := net . ParseCIDR ( a . CIDR ) if err != nil { return " " , errors . Trace ( err ) } ip := a . IP ( ) if ip == nil { return " " , errors . Errorf ( " " , a . Value ) } ipNet . IP = ip return ipNet . String ( ) , nil }
ValueWithMask returns the value of the address combined
with the subnet mask indicated by its CIDR.
ValueWithMask returns the value of the address combined with the subnet mask indicated by its CIDR .
// Returning a NotFound error preserves prior behaviour from when // CIDRAddress was a method on InterfaceInfo. // TODO (manadart 2021-03-16): Rethink this as we clean up InterfaceInfos // and its corresponding wire type.