protoc-gen-go-grpc:找不到程序或不可执行 [英] protoc-gen-go-grpc: program not found or is not executable

查看:2996
本文介绍了protoc-gen-go-grpc:找不到程序或不可执行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

go version:转到版本go1.14 linux/amd64

go version: go version go1.14 linux/amd64

go.mod

module [redacted]

go 1.14

require (
    github.com/golang/protobuf v1.4.0-rc.2
    google.golang.org/grpc v1.27.1
    google.golang.org/protobuf v1.20.0 // indirect
)

我正在运行以下命令:

protoc -I ./src/pbdefs/protos/ --go-grpc_out=. src/pbdefs/protos/*.proto

.proto文件生成我的GRPC输出文件,但出现错误

to generate my GRPC output files from .proto files, with I am getting an error

protoc-gen-go-grpc: program not found or is not executable
Please specify a program using absolute path or make sure the program is available in your PATH system variable
--go-grpc_out: protoc-gen-go-grpc: Plugin failed with status code 1.

推荐答案

好,只是根据

v1.20 protoc-gen-go不支持生成gRPC服务定义.将来,Go gRPC项目将提供一个新的protoc-gen-go-grpc插件来支持gRPC服务的生成.

The v1.20 protoc-gen-go does not support generating gRPC service definitions. In the future, gRPC service generation will be supported by a new protoc-gen-go-grpc plugin provided by the Go gRPC project.

protoc-gen-go的github.com/golang/protobuf版本继续支持gRPC,并将在可预见的将来继续提供支持.

The github.com/golang/protobuf version of protoc-gen-go continues to support gRPC and will continue to do so for the foreseeable future.

编辑29/05/2020:

EDIT 29/05/2020:

根据在github上的跟踪问题,评论中@Mark进行了更新protoc-gen-go-grpc现在已被合并.但是,根据同一问题:

Following an update from @Mark in the comments, according to the Tracking issue on github, protoc-gen-go-grpc has now been merged. However, according to the same issue:

即使已合并,它仍未发布(v0.0)并可能更改.我们确实计划增加一个要求,即未实现的服务实现应包含在所有已注册的服务中,并使用@neild建议的命令行arg形式的转义填充.

Even with this merged, it is unreleased (v0.0) and subject to change. We do plan to add a requirement that the Unimplemented service implementation be included in all registered services, with an escape hatch in the form of a command-line arg as suggested by @neild.

这篇关于protoc-gen-go-grpc:找不到程序或不可执行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆