From e12b0631c35eb1c0c0eb864704d6b1ca8259a34c Mon Sep 17 00:00:00 2001 From: xqbumu Date: Thu, 24 Dec 2020 17:29:48 +0800 Subject: [PATCH] fix ineffectual and remove logs in test --- validator_test.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/validator_test.go b/validator_test.go index 73d0ed1..be1bd0a 100644 --- a/validator_test.go +++ b/validator_test.go @@ -8,7 +8,6 @@ import ( "encoding/base64" "encoding/json" "fmt" - "log" "path/filepath" "reflect" "strings" @@ -8984,6 +8983,8 @@ func TestTranslationFieldErrors(t *testing.T) { return t }) + Equal(t, err, nil) + err = validate.Var("", "required") NotEqual(t, err, nil) @@ -8992,11 +8993,9 @@ func TestTranslationFieldErrors(t *testing.T) { Equal(t, ok, true) for _, e := range errs { - selfErr = append(selfErr, e) + selfErr = append(selfErr, SelfError{e}) } - errTrans := selfErr.Translate(trans) - log.Println(errTrans) Equal(t, selfErr.Translate(trans), ValidationErrorsTranslations{ "": " is a required field", })