mirror of
https://gitee.com/johng/gf.git
synced 2024-12-02 04:07:47 +08:00
Adjust the function sequence
This commit is contained in:
parent
892619678e
commit
b4e6abc460
@ -189,6 +189,16 @@ func ExampleValidator_Data() {
|
||||
// The Password2 value `gofra` is not a valid password format
|
||||
}
|
||||
|
||||
func ExampleValidator_Data_Value() {
|
||||
err := g.Validator().Rules("min:18").
|
||||
Messages("未成年人不允许注册哟").
|
||||
Data(16).Run(gctx.New())
|
||||
fmt.Println(err.String())
|
||||
|
||||
// Output:
|
||||
// 未成年人不允许注册哟
|
||||
}
|
||||
|
||||
func ExampleValidator_Data_Map1() {
|
||||
params := map[string]interface{}{
|
||||
"passport": "",
|
||||
@ -480,16 +490,6 @@ func ExampleValidator_RuleFuncMap() {
|
||||
// Value Length Error!; Pass is not Same!
|
||||
}
|
||||
|
||||
func ExampleValidator_Data_Value() {
|
||||
err := g.Validator().Rules("min:18").
|
||||
Messages("未成年人不允许注册哟").
|
||||
Data(16).Run(gctx.New())
|
||||
fmt.Println(err.String())
|
||||
|
||||
// Output:
|
||||
// 未成年人不允许注册哟
|
||||
}
|
||||
|
||||
func ExampleValidator_RegisterRule() {
|
||||
type User struct {
|
||||
Id int
|
||||
|
Loading…
Reference in New Issue
Block a user