code: func ParseIPWithPrefix(input string) (addr *net.IPNet, isIpv6 bool, err error) {
  	defaultIpv4Mask := net.CIDRMask(32, 32)
  	defaultIpv6Mask := net.CIDRMask(128, 128)
  
  	hasPrefix := strings.Contains(input, "/")
  
  	if hasPrefix {
  		ip, network, err := net.ParseCIDR(input)
  		if err != nil {
  			return nil, false, err
  		}
  		network.IP = ip
  		isIpv6, err = IsIPv6(ip.String())
  		return network, isIpv6, err
  	}
  
  	// Ip prefix was not set
  	ip := net.ParseIP(input)
  	if ip == nil {
  		return nil, false, fmt.Errorf("Unable to parse IP address: %v", input)
  	}
  	isIpv6, err = IsIPv6(ip.String())
  	if err != nil {
  		return
  	}
  
  	network := net.IPNet{}
  	network.IP = ip
  	if isIpv6 {
  		network.Mask = defaultIpv6Mask
  	} else {
  		network.Mask = defaultIpv4Mask
  	}
  	return &network, isIpv6, nil
  }
docs: // ParseIPWithPrefix parses string representation of ip address into net.IPNet structure.
  // If the prefix is missing default one is added (/32 for IPv4, /128 for IPv6)