core/grpc: fix deprecated protobuf package, remove tools (#4643)

This commit is contained in:
Caleb Doxsey 2023-10-26 11:38:54 -06:00 committed by GitHub
parent 5240baf202
commit 818f3926bf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
26 changed files with 58 additions and 86 deletions

View file

@ -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
}