其他分享
首页 > 其他分享> > gopkg.in/go-playground/validator中比较有用的标签

gopkg.in/go-playground/validator中比较有用的标签

作者:互联网

-
|
omitempty 有则验证,空值则不验证
dive
required 、 required_with[_all]、 required_without[_all]
len
max、min
eq、ne、{l|g}t[e]
oneof
alpha alphanum numberic hexadecimal
contains containsany containsrune excludes excludesall excludesrune
ip ipv4 ipv6 cidr cidrv{4|6} {t|u}cp[{4|6}]_addr 可解析的IP地址:ip[{4|6}]_addr mac
email url uri
ascii asciiprint multibyte

v9版本支持:path dir unique alphaunicode alphanumunicode startswith endswith html html_encoded url_encoded

标签:addr,验证,url,required,html,gopkg,validator,playground,encoded
来源: https://www.cnblogs.com/mind-water/p/11065046.html