Thanks for your sharing, I have some update for you to check out.
I found a version mismatching issue when I followed your tutorial.
My versions:
protoc-gen-go v1.23.0
protoc v3.13.0
The error message is showed when I use jsonpb.Marshaler{}.MarshalToString :
message ProtoMessage
cannot use message (type protoreflect.ProtoMessage) as type protoiface.MessageV1 in argument to marshaler.MarshalToString:
protoreflect.ProtoMessage does not implement protoiface.MessageV1 (missing ProtoMessage method)go
multiple-value marshaler.MarshalToString() in single-value contextgo
I checked the solution discussed on github.com/golang/protobuf/issues/... to replace the function of ProtobufToJSON to solved this version mismatching problem with the following change:
Thanks for your sharing, I have some update for you to check out.
I found a version mismatching issue when I followed your tutorial.
The error message is showed when I use
jsonpb.Marshaler{}.MarshalToString
:I checked the solution discussed on github.com/golang/protobuf/issues/... to replace the function of
ProtobufToJSON
to solved this version mismatching problem with the following change: