From b4e6abc4607dcdfcd040e841891321707280f9c1 Mon Sep 17 00:00:00 2001 From: huangqian Date: Sat, 11 Dec 2021 23:11:17 +0800 Subject: [PATCH] Adjust the function sequence --- util/gvalid/gvalid_z_example_test.go | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/util/gvalid/gvalid_z_example_test.go b/util/gvalid/gvalid_z_example_test.go index 0c56c37f9..e438ce710 100644 --- a/util/gvalid/gvalid_z_example_test.go +++ b/util/gvalid/gvalid_z_example_test.go @@ -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