I'm a bit confused about protoc-gen-go
vs protoc-gen-go-grpc
. I know that:
protoc-gen-go
contains that code for the serialization/deserialization of protobuf messagesprotoc-gen-go-grpc
contains the code for gRPC Server and Client
But, I'm using the following command
protoc -I $protodir --go_out=plugins=grpc:./genproto/ $protodir/v1/foo.proto
and the generated foo.pb.go
contains both code for message serialization and for gRPC server/client. Plus that I only have protoc-gen-go
installed on my system.
I have the feeling that this is the old-way of doing gRPC in GO while the new-way is with protoc --go_out=. --go-grpc_out=.
Questions:
- why is this working with only
protoc --go_out=.
(why does it also generates gRPC client/server code?) - what is the advantage of using one method vs. the other?
Thanks, DC