Update dependencies (#333)

This commit is contained in:
tobi 2021-11-27 15:26:58 +01:00 committed by GitHub
commit 182b4eea73
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
848 changed files with 377869 additions and 107280 deletions

View file

@ -5,11 +5,10 @@
package binding
import (
"errors"
"io/ioutil"
"net/http"
"google.golang.org/protobuf/proto"
"github.com/golang/protobuf/proto"
)
type protobufBinding struct{}
@ -27,11 +26,7 @@ func (b protobufBinding) Bind(req *http.Request, obj interface{}) error {
}
func (protobufBinding) BindBody(body []byte, obj interface{}) error {
msg, ok := obj.(proto.Message)
if !ok {
return errors.New("obj is not ProtoMessage")
}
if err := proto.Unmarshal(body, msg); err != nil {
if err := proto.Unmarshal(body, obj.(proto.Message)); err != nil {
return err
}
// Here it's same to return validate(obj), but util now we can't add