Selaa lähdekoodia

Fix unexported field detection

Javier Provecho Fernandez 11 vuotta sitten
vanhempi
commit
6d92063b99
1 muutettua tiedostoa jossa 1 lisäystä ja 1 poistoa
  1. 1 1
      binding/binding.go

+ 1 - 1
binding/binding.go

@@ -170,7 +170,7 @@ func Validate(obj interface{}) 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
 			}