install specific version of protoc-gen-go

This commit is contained in:
Michael Schurter
2019-01-29 15:37:01 -08:00
parent bb514cfa39
commit 837e550dd3
2 changed files with 10 additions and 1 deletions

View File

@@ -0,0 +1,9 @@
#!/usr/bin/env bash
GIT_TAG="v1.2.0" # change as needed
echo "Installing protobuf/protoc-gen-go@${GIT_TAG} ..."
# Either fetch in existing repo or use go get to clone
git -C "$(go env GOPATH)"/src/github.com/golang/protobuf fetch -q || go get -d -u github.com/golang/protobuf/protoc-gen-go
git -C "$(go env GOPATH)"/src/github.com/golang/protobuf checkout --quiet $GIT_TAG
go install github.com/golang/protobuf/protoc-gen-go