diff --git a/binding/form.go b/binding/form.go index 2e26c0ac..557333e6 100644 --- a/binding/form.go +++ b/binding/form.go @@ -10,11 +10,11 @@ type formBinding struct{} type formPostBinding struct{} type formMultipartBinding struct{} -func (_ formBinding) Name() string { +func (formBinding) Name() string { return "form" } -func (_ formBinding) Bind(req *http.Request, obj interface{}) error { +func (formBinding) Bind(req *http.Request, obj interface{}) error { if err := req.ParseForm(); err != nil { return err } @@ -25,11 +25,11 @@ func (_ formBinding) Bind(req *http.Request, obj interface{}) error { return validate(obj) } -func (_ formPostBinding) Name() string { +func (formPostBinding) Name() string { return "form-urlencoded" } -func (_ formPostBinding) Bind(req *http.Request, obj interface{}) error { +func (formPostBinding) Bind(req *http.Request, obj interface{}) error { if err := req.ParseForm(); err != nil { return err } @@ -39,11 +39,11 @@ func (_ formPostBinding) Bind(req *http.Request, obj interface{}) error { return validate(obj) } -func (_ formMultipartBinding) Name() string { +func (formMultipartBinding) Name() string { return "multipart/form-data" } -func (_ formMultipartBinding) Bind(req *http.Request, obj interface{}) error { +func (formMultipartBinding) Bind(req *http.Request, obj interface{}) error { if err := req.ParseMultipartForm(32 << 10); err != nil { return err } diff --git a/binding/json.go b/binding/json.go index 25c5a06c..6e532443 100644 --- a/binding/json.go +++ b/binding/json.go @@ -12,11 +12,11 @@ import ( type jsonBinding struct{} -func (_ jsonBinding) Name() string { +func (jsonBinding) Name() string { return "json" } -func (_ jsonBinding) Bind(req *http.Request, obj interface{}) error { +func (jsonBinding) Bind(req *http.Request, obj interface{}) error { decoder := json.NewDecoder(req.Body) if err := decoder.Decode(obj); err != nil { return err diff --git a/binding/xml.go b/binding/xml.go index cac4be89..f84a6b7f 100644 --- a/binding/xml.go +++ b/binding/xml.go @@ -11,11 +11,11 @@ import ( type xmlBinding struct{} -func (_ xmlBinding) Name() string { +func (xmlBinding) Name() string { return "xml" } -func (_ xmlBinding) Bind(req *http.Request, obj interface{}) error { +func (xmlBinding) Bind(req *http.Request, obj interface{}) error { decoder := xml.NewDecoder(req.Body) if err := decoder.Decode(obj); err != nil { return err