Merge branch 'master' into optimize-code-adjust

This commit is contained in:
Bo-Yi Wu 2021-04-29 15:50:06 +08:00 committed by GitHub
commit f767157bfb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6,7 +6,7 @@ package binding
import (
"bytes"
"fmt"
"errors"
"io"
"net/http"
@ -32,7 +32,7 @@ func (jsonBinding) Name() string {
func (jsonBinding) Bind(req *http.Request, obj interface{}) error {
if req == nil || req.Body == nil {
return fmt.Errorf("invalid request")
return errors.New("invalid request")
}
return decodeJSON(req.Body, obj)
}