mirror of
https://github.com/gin-gonic/gin.git
synced 2025-10-14 20:22:20 +08:00
skip unexported fields for bindings
This commit is contained in:
parent
0808f8a824
commit
9a8621cea1
@ -174,6 +174,11 @@ func Validate(obj interface{}) error {
|
||||
continue
|
||||
}
|
||||
|
||||
// skip unexported fields
|
||||
if field.PkgPath != "" {
|
||||
continue
|
||||
}
|
||||
|
||||
fieldValue := val.Field(i).Interface()
|
||||
zero := reflect.Zero(field.Type).Interface()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user