mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-08-14 07:28:28 +02:00
Update dependencies (#333)
This commit is contained in:
9
vendor/github.com/gin-gonic/gin/binding/protobuf.go
generated
vendored
9
vendor/github.com/gin-gonic/gin/binding/protobuf.go
generated
vendored
@ -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
|
||||
|
Reference in New Issue
Block a user