I think the first one specifies a plugin needed for gRPC, but if you're just using Go protobuf without gRPC then there is no need to specify a plugin.
On Mon, Aug 5, 2019 at 3:23 AM Niket Agrawal <[email protected]> wrote: > Hello, > > I came across two versions of the command to produce the compiler > generated code for the .proto files I wrote and I am seeking clarification > on which one should I use for my purpose. I am using Golang for my > application development so after installing the protoc comiler I already > installed the protoc plugin for Golang. I presume a flag or a plugin should > be passed to the command to let the compiler generate code for that > particular language? > > The first command I came across s mentioned on the GRPC Golang tutotials ( > https://grpc.io/docs/quickstart/go/) > > *protoc -I helloworld/ helloworld/helloworld.proto > --go_out=plugins=grpc:helloworld* > > The second command that I came across is on the protocol buffers Golang > tutorial page ( > https://developers.google.com/protocol-buffers/docs/gotutorial) > > *protoc -I=$SRC_DIR --go_out=$DST_DIR $SRC_DIR/addressbook.proto* > > The main difference I see on comparing the two commands is that the first > one specifies a plugin while the second one doesn't. Could anyone explain > this difference and which one should work for my case? > > Regards, > Niket > > -- > You received this message because you are subscribed to the Google Groups > "Protocol Buffers" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/protobuf/fb191364-d7a1-48f4-ae9a-4a71fd4c816b%40googlegroups.com > <https://groups.google.com/d/msgid/protobuf/fb191364-d7a1-48f4-ae9a-4a71fd4c816b%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "Protocol Buffers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/protobuf/CADqAXr7dKKZACgit4ho_B2TN9eZhfxYhvVZWyq_yEn1J6SHn%3Dw%40mail.gmail.com.
