浏览代码

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

Fix unexported field detection
Javier Provecho Fernandez 10 年之前
父节点
当前提交
5dad47bca2
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      binding/binding.go

+ 1 - 1
binding/binding.go

@@ -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
 			}