Fix unexported field detection
This commit is contained in:
parent
c8dedf7f39
commit
6d92063b99
@ -170,7 +170,7 @@ func Validate(obj interface{}) error {
|
|||||||
field := typ.Field(i)
|
field := typ.Field(i)
|
||||||
|
|
||||||
// Allow ignored and unexported fields in the struct
|
// Allow ignored and unexported fields in the struct
|
||||||
if field.Tag.Get("form") == "-" || field.PkgPath != "" {
|
if len(field.PkgPath) > 0 || field.Tag.Get("form") == "-" {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user