func newNetAddr(a string) (*netAddr, error) {
	res := &netAddr{
		addr: a,
	}

	ip, ipNet, err := net.ParseCIDR(a)
	if ipNet != nil {
		res.ipNet = ipNet
	}

	if ip == nil {
		ip = net.ParseIP(a)
	}

	if ip == nil {
		if err != nil {
			return nil, errors.Trace(err)
		}
		return nil, errors.Errorf("unable to parse IP address %q", a)
	}

	res.ip = ip
	return res, nil
}
// newNetAddr returns a new netAddr reference
// representing the input IP address string.
newNetAddr returns a new netAddr reference
representing the input IP address string.
// newNetAddr returns a new netAddr reference // representing the input IP address string .
func newNetAddr(a string) (*netAddr, error) {
	res := &netAddr{
		addr: a,
	}
	ip, ipNet, err := net.ParseCIDR(a)
	if ipNet != nil {
		res.ipNet = ipNet
	}
	if ip == nil {
		ip = net.ParseIP(a)
	}
	if ip == nil {
		if err != nil {
			return nil, errors.Trace(err)
		}
		return nil, errors.Errorf("unable to parse IP address %q", a)
	}
	res.ip = ip
	return res, nil
}
func newNetAddr ( a string ) ( * netAddr , error ) { res := & netAddr { addr : a , } ip , ipNet , err := net . ParseCIDR ( a ) if ipNet != nil { res . ipNet = ipNet } if ip == nil { ip = net . ParseIP ( a ) } if ip == nil { if err != nil { return nil , errors . Trace ( err ) } return nil , errors . Errorf ( " " , a ) } res . ip = ip return res , nil }
newNetAddr returns a new netAddr reference
representing the input IP address string.
newNetAddr returns a new netAddr reference representing the input IP address string .