Updating Protobuf and GRPC in Golang

轉自: http://russmatney.com/techsposure/update-protobuf-golang-grpc/html


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.git


Go Dependencies

Update your relevant go dependencies:github

sh go get -u github.com/golang/protobuf/{proto,protoc-gen-go} && \ go get -u google.golang.org/grpcgolang

Update Protoc

Then (or before) download and install the latest protoc binary: github.com/google/protobuf/releases.post

Download the zip, open it, and move the protoc executable file into somewhere on your path.ui

sh mv ~/Downloads/protoc-3.0.0-beta-3.1-osx-x86_64/protoc /usr/localthis

Rebuild where necessary

Rebuild your .protoc files, likely per project.google

For me, this means running go generate ./... in each go project’s root directory.spa

Published: July 09 2016code

相關文章
相關標籤/搜索