mirror of
https://github.com/pomerium/pomerium.git
synced 2025-05-16 02:27:40 +02:00
core/grpc: fix deprecated protobuf package, remove tools (#4643)
This commit is contained in:
parent
5240baf202
commit
818f3926bf
26 changed files with 58 additions and 86 deletions
|
@ -8,10 +8,10 @@ import (
|
|||
"reflect"
|
||||
"testing"
|
||||
|
||||
"github.com/golang/protobuf/proto"
|
||||
"github.com/google/go-cmp/cmp"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"google.golang.org/protobuf/encoding/protojson"
|
||||
"google.golang.org/protobuf/reflect/protoreflect"
|
||||
"google.golang.org/protobuf/testing/protocmp"
|
||||
)
|
||||
|
||||
|
@ -47,8 +47,7 @@ func reformatJSON(raw json.RawMessage) string {
|
|||
}
|
||||
|
||||
func toProtoJSON(protoMsg interface{}) json.RawMessage {
|
||||
v2 := proto.MessageV2(protoMsg)
|
||||
bs, _ := protojson.Marshal(v2)
|
||||
bs, _ := protojson.Marshal(protoMsg.(protoreflect.ProtoMessage))
|
||||
return bs
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue