func IsIP(ip string) bool {
	return net.ParseIP(ip) != nil
}
IsIP determines if the given string is a valid ip
package iputil
import "net"
func IsCidr(ip string) bool {
	_, _, err := net.ParseCIDR(ip)
	return err == nil
}