1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-14 17:30:55 +00:00

fix exist typo

This commit is contained in:
陈晓宇 2020-02-14 16:47:47 +08:00
parent de5650b723
commit 713503e43d
2 changed files with 3 additions and 3 deletions

View File

@ -224,7 +224,7 @@ func parseFunc(vfunc, key string, label string) (v ValidFunc, err error) {
func numIn(name string) (num int, err error) { func numIn(name string) (num int, err error) {
fn, ok := funcs[name] fn, ok := funcs[name]
if !ok { if !ok {
err = fmt.Errorf("doesn't exsits %s valid function", name) err = fmt.Errorf("doesn't exists %s valid function", name)
return return
} }
// sub *Validation obj and key // sub *Validation obj and key
@ -236,7 +236,7 @@ func trim(name, key string, s []string) (ts []interface{}, err error) {
ts = make([]interface{}, len(s), len(s)+1) ts = make([]interface{}, len(s), len(s)+1)
fn, ok := funcs[name] fn, ok := funcs[name]
if !ok { if !ok {
err = fmt.Errorf("doesn't exsits %s valid function", name) err = fmt.Errorf("doesn't exists %s valid function", name)
return return
} }
for i := 0; i < len(s); i++ { for i := 0; i < len(s); i++ {

View File

@ -42,7 +42,7 @@ func TestGetValidFuncs(t *testing.T) {
} }
f, _ = tf.FieldByName("Tag") f, _ = tf.FieldByName("Tag")
if _, err = getValidFuncs(f); err.Error() != "doesn't exsits Maxx valid function" { if _, err = getValidFuncs(f); err.Error() != "doesn't exists Maxx valid function" {
t.Fatal(err) t.Fatal(err)
} }