Merge 05c2fda5b71b94ecfe86d147975181ab62643a05 into 957f6205c83edda01be3a6dd74cdc1859b660ba0

This commit is contained in:
sidbusy 2017-04-19 07:11:46 +00:00 committed by GitHub
commit 663fe64535

View File

@ -348,11 +348,7 @@ func (c *Context) BindJSON(obj interface{}) error {
// BindWith binds the passed struct pointer using the specified binding engine.
// See the binding package.
func (c *Context) BindWith(obj interface{}, b binding.Binding) error {
if err := b.Bind(c.Request, obj); err != nil {
c.AbortWithError(400, err).SetType(ErrorTypeBind)
return err
}
return nil
return b.Bind(c.Request, obj)
}
// ClientIP implements a best effort algorithm to return the real client IP, it parses