func (s SubnetInfos) GetByAddress(addr string) (SubnetInfos, error) {
	ip := net.ParseIP(addr)
	if ip == nil {
		return nil, errors.NotValidf("%q as IP address", addr)
	}

	var subs SubnetInfos
	for _, sub := range s {
		ipNet, err := sub.ParsedCIDRNetwork()
		if err != nil {
			return nil, errors.Trace(err)
		}
		if ipNet.Contains(ip) {
			subs = append(subs, sub)
		}
	}
	return subs, nil
}
// GetByAddress returns subnets that based on IP range,
// include the input IP address.
GetByAddress returns subnets that based on IP range,
include the input IP address.
// GetByAddress returns subnets that based on IP range // include the input IP address .
func (s SubnetInfos) GetByAddress(addr string) (SubnetInfos, error) {
	ip := net.ParseIP(addr)
	if ip == nil {
		return nil, errors.NotValidf("%q as IP address", addr)
	}
	var subs SubnetInfos
	for _, sub := range s {
		ipNet, err := sub.ParsedCIDRNetwork()
		if err != nil {
			return nil, errors.Trace(err)
		}
		if ipNet.Contains(ip) {
			subs = append(subs, sub)
		}
	}
	return subs, nil
}
func ( s SubnetInfos ) GetByAddress ( addr string ) ( SubnetInfos , error ) { ip := net . ParseIP ( addr ) if ip == nil { return nil , errors . NotValidf ( " " , addr ) } var subs SubnetInfos for _ , sub := range s { ipNet , err := sub . ParsedCIDRNetwork ( ) if err != nil { return nil , errors . Trace ( err ) } if ipNet . Contains ( ip ) { subs = append ( subs , sub ) } } return subs , nil }
GetByAddress returns subnets that based on IP range,
include the input IP address.
GetByAddress returns subnets that based on IP range include the input IP address .