0

I just try to build 100% valid protobuf files on Windows with --go_out protoc plugin but it fails. It doesn't report any error in protobuf files. A only see the generated code as output and the --go_out error message like so:

<generated code at stdout>
--go_out: protoc-gen-go: Plugin failed with status code 1.

What should I do to fix it?

Dr.eel
  • 1,837
  • 3
  • 18
  • 28

2 Answers2

0

Check the encoding and line endings of *.proto files. In my fileset there were some files in UTF-8 without BOM and windows line endings, and other with Windows-1251 and UNIX line endings.

I fixed it by changing encoding of files to UTF-8 without BOM and windows line endings. And protoc built go files successfully.

Dr.eel
  • 1,837
  • 3
  • 18
  • 28
0

Did u use the protoc command,

You can use following command to build

protoc -I=<ABS_PATH_OUTPUT_DIR> --go_out=<ABS_PATH_PROTO_FILE>