本文主要是介绍protoc-gen-go: program not found or is not executable,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
proto定义的协议信息:
syntax = "proto3";
package main;
option go_package = "./;message"; //分号前面指定要生成.pb.go文件的存放位置,这里是当前目录。分号后面是生成.pb.go文件的包名message Student {string name = 1;bool male = 2;repeated int32 scores = 3;
}
生成pb.go命令:
protoc --go_out=plugins=grpc:. *.proto
执行proto生成.pb.go文件时报错:
protoc-gen-go: program not found or is not executable
--go_out: protoc-gen-go: Plugin failed with status code 1.
/etc/profile环境变量设置有问题,之前删掉了$GOPATH的bin
这篇关于protoc-gen-go: program not found or is not executable的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!