mirror of
https://github.com/gin-gonic/gin.git
synced 2025-10-15 13:02:14 +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
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// skip unexported fields
|
||||||
|
if field.PkgPath != "" {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
fieldValue := val.Field(i).Interface()
|
fieldValue := val.Field(i).Interface()
|
||||||
zero := reflect.Zero(field.Type).Interface()
|
zero := reflect.Zero(field.Type).Interface()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user