Skip to content

Commit fe1f188

Browse files
committed
fix: use standard pb package instead
Change-Id: Id2aada2c43b10e9c8d40f272f88c665d32ff6119
1 parent bd5bf45 commit fe1f188

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

binding/body.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
"net/http"
99
"strings"
1010

11-
"github.com/gogo/protobuf/proto"
11+
"google.golang.org/protobuf/proto"
1212
)
1313

1414
func getBodyCodec(req Request) codec {

binding/func.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import (
77
"reflect"
88
"time"
99

10-
"github.com/gogo/protobuf/proto"
1110
"github.com/henrylee2cn/ameda"
11+
"google.golang.org/protobuf/proto"
1212
)
1313

1414
// JSONUnmarshaler is the interface implemented by types
@@ -66,8 +66,8 @@ func unmarshal(b []byte, i interface{}) error {
6666
switch x := i.(type) {
6767
case jsonpkg.Unmarshaler:
6868
return x.UnmarshalJSON(b)
69-
case proto.Unmarshaler:
70-
return x.Unmarshal(b)
69+
case proto.Message:
70+
return proto.Unmarshal(b, x)
7171
default:
7272
return jsonpkg.Unmarshal(b, i)
7373
}

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ go 1.14
44

55
require (
66
github.com/davecgh/go-spew v1.1.1 // indirect
7-
github.com/gogo/protobuf v1.3.1
87
github.com/henrylee2cn/ameda v1.4.10
98
github.com/henrylee2cn/goutil v0.0.0-20210127050712-89660552f6f8
109
github.com/nyaruka/phonenumbers v1.0.55
1110
github.com/stretchr/testify v1.5.1
1211
github.com/tidwall/gjson v1.6.0
12+
google.golang.org/protobuf v1.27.1
1313
)

0 commit comments

Comments
 (0)