Adjust the function sequence

This commit is contained in:
huangqian 2021-12-11 23:11:17 +08:00
parent 892619678e
commit b4e6abc460

View File

@ -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