func ParseIPv4(ip string) ([]net.IP, error) {
	parts := strings.Split(ip, "/")
	if len(parts) > 2 {
		return nil, fmt.Errorf("parse/ParseIPv4: Invalid IP Address %s", ip)
	}

	ips, err := parseIPv4(parts[0])
	if err != nil {
		return nil, err
	}

	var cidr int64

	if len(parts) != 2 {
		cidr = 32
	} else {

		cidr, err = strconv.ParseInt(parts[1], 0, 8)
		if err != nil {
			return nil, err
		}

		if cidr > 32 {
			return nil, fmt.Errorf("parse/ParseIPv4: Invalid IP Address %s: Invalid CIDR notation", ip)
		}
	}

	return parseIPv4CIDR(ips, net.CIDRMask(int(cidr), 32))
}
// ParseIPv4 is called by ParseIP for IPv4 addresses. See ParseIP for more detials.
ParseIPv4 is called by ParseIP for IPv4 addresses. See ParseIP for more detials.
// ParseIPv4 is called by ParseIP for IPv4 addresses . See ParseIP for more detials .
func ParseIPv4(ip string) ([]net.IP, error) {
	parts := strings.Split(ip, "/")
	if len(parts) > 2 {
		return nil, fmt.Errorf("parse/ParseIPv4: Invalid IP Address %s", ip)
	}
	ips, err := parseIPv4(parts[0])
	if err != nil {
		return nil, err
	}
	var cidr int64
	if len(parts) != 2 {
		cidr = 32
	} else {
		cidr, err = strconv.ParseInt(parts[1], 0, 8)
		if err != nil {
			return nil, err
		}
		if cidr > 32 {
			return nil, fmt.Errorf("parse/ParseIPv4: Invalid IP Address %s: Invalid CIDR notation", ip)
		}
	}
	return parseIPv4CIDR(ips, net.CIDRMask(int(cidr), 32))
}
func ParseIPv4 ( ip string ) ( [ ] net . IP , error ) { parts := strings . Split ( ip , " " ) if len ( parts ) > 2 { return nil , fmt . Errorf ( " " , ip ) } ips , err := parseIPv4 ( parts [ 0 ] ) if err != nil { return nil , err } var cidr int64 if len ( parts ) != 2 { cidr = 32 } else { cidr , err = strconv . ParseInt ( parts [ 1 ] , 0 , 8 ) if err != nil { return nil , err } if cidr > 32 { return nil , fmt . Errorf ( " " , ip ) } } return parseIPv4CIDR ( ips , net . CIDRMask ( int ( cidr ) , 32 ) ) }
ParseIPv4 is called by ParseIP for IPv4 addresses.
ParseIPv4 is called by ParseIP for IPv4 addresses .