mirror of https://github.com/gin-gonic/gin.git
Removes unused underscore
This commit is contained in:
parent
fc5e355724
commit
0494e1b66a
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue