Support for Go is not built into protoc. Instead, Go code gen relies on a
protoc plugin. A serious omission from the help output for protoc is how to
use plugins:

--<plugin>_out  Generate source code by invoking plugin program named
protoc-gen-<plugin>.

So, to use the --go_out flag, you need to install the Go plugin, which is
named protoc-gen-go
<https://github.com/golang/protobuf/tree/master/protoc-gen-go>. To install
that plugin, you can use the Go tool:

go get github.com/golang/protobuf/protoc-gen-go

When protoc tries to invoke protoc-gen-go, it will expect to find it in
your PATH environment. But you can also use a --plugin flag to protoc to
tell it exactly where the plugin binary lives.

----
*Josh Humphries*
jh...@bluegosling.com


On Sun, Nov 18, 2018 at 4:57 PM Tharaneedharan Vilwanathan <
vdhar...@gmail.com> wrote:

> Hi All,
>
> I have a minor question. When I run "protoc --help", I do not see "go_out"
> option but I see others:
>
>   --cpp_out=OUT_DIR           Generate C++ header and source.
>   --csharp_out=OUT_DIR        Generate C# source file.
>   --java_out=OUT_DIR          Generate Java source file.
>   --js_out=OUT_DIR            Generate JavaScript source.
>   --objc_out=OUT_DIR          Generate Objective C header and source.
>   --php_out=OUT_DIR           Generate PHP source file.
>   --python_out=OUT_DIR        Generate Python source file.
>   --ruby_out=OUT_DIR          Generate Ruby source file.
>
> Is it a minor bug or am I missing something?
>
> Thanks
> dharani
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to golang-nuts+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to