美文网首页
grpc linux安装

grpc linux安装

作者: 天地一小儒 | 来源:发表于2019-08-07 10:12 被阅读0次

1. go protobuf 安装

详细见官方文档安装说明

Protoc Buffer 安装包下载地址:https://github.com/protocolbuffers/protobuf/releases/download/v3.9.0/protoc-3.9.0-linux-x86_64.zip(使用wget命令下载),最新版本可在此页面查看。
下载完成后,解压。将解压出来的include文件夹合并放入/usr/local/include(可能需要sudo权限),将解压出来的bin文件夹合并放入$GOPATH/bin。

上述涉及到的命令:

wget https://github.com/protocolbuffers/protobuf/releases/download/v3.9.0/protoc-3.9.0-linux-x86_64.zip
unzip protoc-3.9.0-linux-x86_64.zip
mv include /usr/local/
mv bin $GOPATH/

2. github 依赖

$GOPATH/src/golang.org/x 下执行( 不存在就手动mkdir)

git clone git@github.com:golang/sys.git
git clone git@github.com:golang/net.git
git clone git@github.com:golang/text.git

$GOPATH/src/google.golang.org 下执行( 不存在就手动mkdir)

git clone git@github.com:grpc/grpc-go.git grpc
git clone git@github.com:googleapis/go-genproto.git genproto

3. 错误集锦

  • undefined: "github.com/gaeanetwork/gaea-core/vendor/github.com/golang/protobuf/proto".ProtoPackageIsVersion3 包的问题,需要重新编译,在任意目录下,执行:
go install github.com/golang/protobuf/protoc-gen-go

注意,确保你电脑上的包的版本是最新的。

相关文章

网友评论

      本文标题:grpc linux安装

      本文链接:https://www.haomeiwen.com/subject/pblidctx.html