首先,确保您已经安装了 protoc-gen-go。对于使用Go模块的项目,您可以通过以下命令安装: bash go install google.golang.org/protobuf/cmd/protoc-gen-go@latest 如果您使用的是较旧的Go版本(例如1.11或更早),可能需要使用 go get 代替go install,但请注意,现代Go版本推荐使用 go install。
在使用Protocol Buffers的过程中,可能会遇到一些错误。比如,你可能会看到这样的错误信息:"protoc-gen-go: 程序找不到或不可执行"。这个错误通常是由于系统中缺少名为 "protoc-gen-go" 的可执行文件,或者是该文件的路径没有被添加到系统的 PATH 环境变量中。 为了解决这个问题,你需要首先安装正确的 "protoc-gen-...
1 protoc --proto_path=./protos/ ./protos/*.proto --go_out=plugins=grpc:./pb 又报错: --go_out: protoc-gen-go: plugins are not supported; use 'protoc --go-grpc_out=...' to generate gRPC 改下命令参数成功生成: 1 protoc --proto_path=./protos/ ./protos/*.proto --go-grpc_out=...
But when trying to do the same in golang: protoc --go_out=. addressbook.proto protoc-gen-go: program not found or is not executable --go_out: protoc-gen-go: Plugin failed with status code 1. Other information: in my .bashrc I added the following lines: ...
protoc-gen-go: 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_out: protoc-gen-go: Plugin failed with status code 1. 1.
protoc-gen-go-grpc: program not found or is not executable --go-grpc_out: protoc-gen-go-grpc: Plugin failed with status code 1. make: *** [/home/deckard/go/src/grpcblog/Makefile:2: gen] Error 1 我使用 Ubuntu 20.04?Golang-1.13.8,$GOROOT=和$GOPATH=($HOME是)。原型是 。我安装...
我正在尝试使用 Go gRPC 构建示例应用程序,但我无法使用“protoc”生成代码 我已经使用以下方法安装了所需的库和 Go 包: go get -u google.golang.org/grpc go get -u github.com/golang/protobuf/protoc-gen-go ...
执行protoc --go_out=. --go-grpc_out=. ./cal.proto时出现下面的错误 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 ...
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. ...
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. 原文由 Ayush Gupta 发布,翻译遵循 CC BY-SA ...