1
0
mirror of https://github.com/astaxie/beego.git synced 2025-07-10 02:30:18 +00:00

golint validation

This commit is contained in:
astaxie
2015-09-13 00:13:19 +08:00
parent 1d200da472
commit 2389bc72f9
5 changed files with 202 additions and 113 deletions

View File

@ -20,7 +20,7 @@ import (
)
type user struct {
Id int
ID int
Tag string `valid:"Maxx(aa)"`
Name string `valid:"Required;"`
Age int `valid:"Required;Range(1, 140)"`
@ -33,7 +33,7 @@ func TestGetValidFuncs(t *testing.T) {
var vfs []ValidFunc
var err error
f, _ := tf.FieldByName("Id")
f, _ := tf.FieldByName("ID")
if vfs, err = getValidFuncs(f); err != nil {
t.Fatal(err)
}