I followed the gRPC quickstart document in this link https://grpc.io/docs/languages/go/quickstart/ and while regenerating the gRPC code i am getting error ( Unknown flag: --go_opt) as shown below. Tried all the options but not working. It also gives ( Unknown flag: --go-grpc_opt) error.
Command -
$ protoc \
--go_out=Mgrpc/service_config/service_config.proto=/internal/proto/grpc_service_config:. \
--go-grpc_out=Mgrpc/service_config/service_config.proto=/internal/proto/grpc_service_config:. \
--go-grpc_opt=paths=source_relative \
helloworld/helloworld.proto
Error - Unknown flag: --go_opt
I had a same issue. I removed the installed protobuf compiler and reinstalled protobuf compiler with "Install pre-compiled binaries" option in https://grpc.io/docs/protoc-installation/.
sudo apt-get remove protobuf-compiler
$PB_REL="https://github.com/protocolbuffers/protobuf/releases"
$ curl -LO $PB_REL/download/v3.12.1/protoc-3.12.1-linux-x86_64.zip
$sudo apt install unzip
$unzip protoc-3.12.1-linux-x86_64.zip -d HOME/.local
$export PATH="$PATH:$HOME/.local/bin"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With