mirror of
https://gitee.com/johng/gf.git
synced 2024-12-04 21:28:22 +08:00
19 lines
275 B
Go
19 lines
275 B
Go
package main
|
|
|
|
import (
|
|
"context"
|
|
"github.com/gogf/gf/frame/g"
|
|
"github.com/gogf/gf/util/gvalid"
|
|
)
|
|
|
|
// string默认值校验
|
|
func main() {
|
|
type User struct {
|
|
Uid string `gvalid:"uid@integer"`
|
|
}
|
|
|
|
user := &User{}
|
|
|
|
g.Dump(gvalid.CheckStruct(context.TODO(), user, nil))
|
|
}
|