Merge pull request #132 from smira/develop

Validate should ignore unexported struct fields.
This commit is contained in:
Manu Mtz.-Almeida 2014-10-08 19:21:04 +02:00
commit 292f1ec6df
1 changed files with 2 additions and 2 deletions

View File

@ -169,8 +169,8 @@ func Validate(obj interface{}) error {
for i := 0; i < typ.NumField(); i++ {
field := typ.Field(i)
// Allow ignored fields in the struct
if field.Tag.Get("form") == "-" {
// Allow ignored and unexported fields in the struct
if field.Tag.Get("form") == "-" || field.PkgPath != "" {
continue
}