mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-12-15 00:43:01 -06:00
Update dependencies (#333)
This commit is contained in:
parent
ce22e03f9d
commit
182b4eea73
848 changed files with 377869 additions and 107280 deletions
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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue