From 68aa2c38da9582aa37b3ee3b099251e5bfee3598 Mon Sep 17 00:00:00 2001 From: Javier Provecho Fernandez Date: Wed, 28 Jun 2017 00:46:35 +0200 Subject: [PATCH] fix(context): switch deprecated bindwith for mustbindwith --- context.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/context.go b/context.go index f7c4f17..5c4d27d 100644 --- a/context.go +++ b/context.go @@ -430,12 +430,12 @@ func (c *Context) MultipartForm() (*multipart.Form, error) { // Like ParseBody() but this method also writes a 400 error if the json is not valid. func (c *Context) Bind(obj interface{}) error { b := binding.Default(c.Request.Method, c.ContentType()) - return c.BindWith(obj, b) + return c.MustBindWith(obj, b) } -// BindJSON is a shortcut for c.BindWith(obj, binding.JSON) +// BindJSON is a shortcut for c.MustBindWith(obj, binding.JSON) func (c *Context) BindJSON(obj interface{}) error { - return c.BindWith(obj, binding.JSON) + return c.MustBindWith(obj, binding.JSON) } // MustBindWith binds the passed struct pointer using the specified binding