赞
踩
为什么不叫css ,为了和 前段的css 区分
通过注入脚本获取敏感信息
https://blog.bitsrc.io/top-7-frontend-security-attacks-2e2b56dc2bcc
包validator根据标签 实现结构和各个字段的值验证。
它具有以下独特功能:
使用 go get
go get github.com/go-playground/validator/v10
然后包导入到您自己的代码中。
import "github.com/go-playground/validator/v10"
TODO 看下高版本的GO go install 和 go get的区别
对于字符串,切片,数组和map ,约束其长度。len=10,min=6,max=10,gt=10
对于数值,约束其取值。min,max,eq,ne,gt,gte,lt,lte,oneof=6 8
min 最小值
max 最大值
eq 等于
ne 不等于 not
gt 大于 grant than
get 大于等于 grant equle than
lt 小于等于 less than
lte less
oneof = 6 8
跨字段就在范围约束的基础上加field 后缀
如果还跨结构体(cross struct) 就在跨字段的基础上再field前面加cs
范围约束 cs field
contains 包含子串
containsany 包含任意Unicode字符,containsany=abcd
containsrune 包含rune字符,containsrune= 本文内容由网友自发贡献,转载请注明出处:https://www.wpsshop.cn/w/从前慢现在也慢/article/detail/974695
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。