Updating Protobuf and GRPC in Golang
xiaouisme · · 1339 次点击 · · 开始浏览转自: http://russmatney.com/techsposure/update-protobuf-golang-grpc/
TL;DR: When protobuf updates, all the .protos and deps need to update.
This post is a quick-lookup for how to do that so I’m not googling it every time.
Go Dependencies
Update your relevant go dependencies:
sh go get -u github.com/golang/protobuf/{proto,protoc-gen-go} && \ go get -u google.golang.org/grpc
Update Protoc
Then (or before) download and install the latest protoc binary: github.com/google/protobuf/releases.
Download the zip, open it, and move the protoc executable file into somewhere on your path.
sh mv ~/Downloads/protoc-3.0.0-beta-3.1-osx-x86_64/protoc /usr/local
Rebuild where necessary
Rebuild your .protoc files, likely per project.
For me, this means running go generate ./... in each go project’s root directory.
有疑问加站长微信联系(非本文作者)
入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889
关注微信- 请尽量让自己的回复能够对别人有帮助
- 支持 Markdown 格式, **粗体**、~~删除线~~、
`单行代码` - 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
- 图片支持拖拽、截图粘贴等方式上传
收入到我管理的专栏 新建专栏
转自: http://russmatney.com/techsposure/update-protobuf-golang-grpc/
TL;DR: When protobuf updates, all the .protos and deps need to update.
This post is a quick-lookup for how to do that so I’m not googling it every time.
Go Dependencies
Update your relevant go dependencies:
sh go get -u github.com/golang/protobuf/{proto,protoc-gen-go} && \ go get -u google.golang.org/grpc
Update Protoc
Then (or before) download and install the latest protoc binary: github.com/google/protobuf/releases.
Download the zip, open it, and move the protoc executable file into somewhere on your path.
sh mv ~/Downloads/protoc-3.0.0-beta-3.1-osx-x86_64/protoc /usr/local
Rebuild where necessary
Rebuild your .protoc files, likely per project.
For me, this means running go generate ./... in each go project’s root directory.