从 --go_out=plugins 切换到 -go-grpc_out PATH 问题

Switch from --go_out=plugins to -go-grpc_out PATH problem

我正在尝试设置我的一个较旧的 go/grpc 项目,自上次更改以来大约 4 个月,protoc 和 protoc-gen-go 似乎发生了很大变化。

在我能够生成类似以下文件的日子里:

protoc --go_out=plugins=grpc:. *.proto

因为它仍然记录在: https://github.com/golang/protobuf

但是今天尝试 运行 出现以下错误:

--go_out: protoc-gen-go: plugins are not supported; use 'protoc --go-grpc_out=...' to generate gRPC

好的,所以我尝试使用 --go-grpc_out 标志,但是:

Please specify a program using absolute path or make sure the program is available in your PATH system variable

我错过了什么? protoc-gen-go 注册在路径中,使用旧命令时可以看到。

答案:

protoc-gen-go 的 Short v1.2 不再支持插件。并将被我找不到的 protoc-gen-go-grpc 取代。

但是!

github.com/golang/protobuf 版本的 protoc-gen-go-grpc 仍然并将支持插件。