如何使用插件使用旧版本的Protoc-Gen-Go
我无法生成
protoc -I=./ --go_out=plugins=grpc:. code/proto/*
--go_out: protoc-gen-go: plugins are not supported; use 'protoc --go-grpc_out=...' to generate gRPC
See https://grpc.io/docs/languages/go/quickstart/#regenerate-grpc-code for more information.
make: *** [protoc-gen] Error 1
我不想使用新版本原因再生的grpc的杂质文件,而不是向后兼容,我需要使用该版本(我找不到是哪个)可以运行使用插件
I'm not being able to generate the protobuffer files for grpc
protoc -I=./ --go_out=plugins=grpc:. code/proto/*
--go_out: protoc-gen-go: plugins are not supported; use 'protoc --go-grpc_out=...' to generate gRPC
See https://grpc.io/docs/languages/go/quickstart/#regenerate-grpc-code for more information.
make: *** [protoc-gen] Error 1
I don't want to regenerate using the new version cause is not backwards compatible, I need to use the version (I don't find which one is it) that can run with plugins
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我能够使用此命令生成有效的代码(没有破坏任何内容)。首先使用-go-grpc_out作为替代之前使用的GRPC插件,然后使用此标志require_unimplemented_servers = false = false,以避免添加额外的方法,如果您使用polimorthism,则可以破坏代码
I've been able to generate valid code (doesnt break anything) with this command. First using --go-grpc_out as a replacement of the grpc plugin used before and second using this flag require_unimplemented_servers=false to avoid adding an extra method that can break your code if you're using polimorphism