mirror of
https://gitee.com/johng/gf.git
synced 2024-12-04 21:28:22 +08:00
20 lines
308 B
Go
20 lines
308 B
Go
package main
|
|
|
|
import (
|
|
"github.com/gogf/gf/frame/g"
|
|
"github.com/gogf/gf/util/gvalid"
|
|
)
|
|
|
|
// same校验
|
|
func main() {
|
|
type User struct {
|
|
Pass string `gvalid:"passwd1 @required|length:2,20|password3||密码强度不足"`
|
|
}
|
|
|
|
user := &User{
|
|
Pass: "1",
|
|
}
|
|
|
|
g.Dump(gvalid.CheckStruct(user, nil).Maps())
|
|
}
|