Add slice elements check for not required slice

This commit is contained in:
Evgeny Persienko 2015-02-20 14:33:50 +06:00
parent f145e435c7
commit b537c5d15e
1 changed files with 5 additions and 0 deletions

View File

@ -209,6 +209,11 @@ func Validate(obj interface{}, parents ...string) error {
if err != nil { if err != nil {
return err return err
} }
} else if fieldType == reflect.Slice && field.Type.Elem().Kind() == reflect.Struct {
err := Validate(fieldValue, field.Name)
if err != nil {
return err
}
} }
} }
} }