Merge pull request #188 from gin-gonic/fix-binding

Fix unexported field detection
This commit is contained in:
Javier Provecho Fernandez 2015-02-07 14:38:40 +01:00
commit 5dad47bca2

View File

@ -170,7 +170,7 @@ func Validate(obj interface{}, parents ...string) error {
field := typ.Field(i)
// 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
}