Browse Source

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

Fix unexported field detection
Javier Provecho Fernandez 11 năm trước cách đây
mục cha
commit
5dad47bca2
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  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
 			}