mirror of https://github.com/gin-gonic/gin.git
Fixes integration with "go-validate-yourself"
http://stackoverflow.com/questions/29138591/hiding-nil-values-understanding-why-golang-fails-here
This commit is contained in:
parent
ee3b67eda1
commit
a887e395f3
|
@ -19,5 +19,8 @@ func (_ getFormBinding) Bind(req *http.Request, obj interface{}) error {
|
|||
if err := mapForm(obj, req.Form); err != nil {
|
||||
return err
|
||||
}
|
||||
return _validator.ValidateStruct(obj)
|
||||
if err := _validator.ValidateStruct(obj); err != nil {
|
||||
return error(err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
|
@ -21,5 +21,8 @@ func (_ jsonBinding) Bind(req *http.Request, obj interface{}) error {
|
|||
if err := decoder.Decode(obj); err != nil {
|
||||
return err
|
||||
}
|
||||
return _validator.ValidateStruct(obj)
|
||||
if err := _validator.ValidateStruct(obj); err != nil {
|
||||
return error(err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
|
@ -19,5 +19,8 @@ func (_ postFormBinding) Bind(req *http.Request, obj interface{}) error {
|
|||
if err := mapForm(obj, req.PostForm); err != nil {
|
||||
return err
|
||||
}
|
||||
return _validator.ValidateStruct(obj)
|
||||
if err := _validator.ValidateStruct(obj); err != nil {
|
||||
return error(err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
|
@ -20,5 +20,8 @@ func (_ xmlBinding) Bind(req *http.Request, obj interface{}) error {
|
|||
if err := decoder.Decode(obj); err != nil {
|
||||
return err
|
||||
}
|
||||
return _validator.ValidateStruct(obj)
|
||||
if err := _validator.ValidateStruct(obj); err != nil {
|
||||
return error(err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue