1
0
mirror of https://github.com/astaxie/beego.git synced 2024-12-22 18:20:50 +00:00
This commit is contained in:
qiantao 2020-06-23 10:43:51 +08:00
parent 3879fd9c34
commit a764e17fbf
2 changed files with 4 additions and 4 deletions

2
go.mod
View File

@ -10,7 +10,7 @@ require (
github.com/couchbase/go-couchbase v0.0.0-20200519150804-63f3cdb75e0d
github.com/couchbase/gomemcached v0.0.0-20200526233749-ec430f949808 // indirect
github.com/couchbase/goutils v0.0.0-20180530154633-e865a1461c8a // indirect
github.com/elastic/go-elasticsearch/v6 v6.8.5 // indirect
github.com/elastic/go-elasticsearch/v6 v6.8.5
github.com/elazarl/go-bindata-assetfs v1.0.0
github.com/go-redis/redis v6.14.2+incompatible
github.com/go-sql-driver/mysql v1.4.1

View File

@ -24,7 +24,7 @@ type user struct {
ID int
Tag string `valid:"Maxx(aa)"`
Name string `valid:"Required;"`
Age int `valid:"Required;Range(1, 140)"`
Age int `valid:"Required; Range(1, 140)"`
match string `valid:"Required; Match(/^(test)?\\w*@(/test/);com$/);Max(2)"`
}
@ -83,8 +83,8 @@ func TestGetValidFuncs(t *testing.T) {
type User struct {
Name string `valid:"Required;MaxSize(5)" `
Sex string `valid:"Required;"label:"sex_label"`
Age int `valid:"Required;Range(1, 140);"label:"age_label"`
Sex string `valid:"Required;" label:"sex_label"`
Age int `valid:"Required;Range(1, 140);" label:"age_label"`
}
func TestValidation(t *testing.T) {