diff --git a/errors.go b/errors.go index 6d80433..17d3769 100644 --- a/errors.go +++ b/errors.go @@ -44,12 +44,9 @@ func (ve ValidationErrors) Error() string { buff := bytes.NewBufferString("") - var fe *fieldError - for i := 0; i < len(ve); i++ { - fe = ve[i].(*fieldError) - buff.WriteString(fe.Error()) + buff.WriteString(ve[i].Error()) buff.WriteString("\n") } diff --git a/validator_test.go b/validator_test.go index be1bd0a..119b7ac 100644 --- a/validator_test.go +++ b/validator_test.go @@ -8996,6 +8996,7 @@ func TestTranslationFieldErrors(t *testing.T) { selfErr = append(selfErr, SelfError{e}) } + NotEqual(t, selfErr.Error(), "") Equal(t, selfErr.Translate(trans), ValidationErrorsTranslations{ "": " is a required field", })