Skip to content

Instantly share code, notes, and snippets.

@dzungtran
Last active December 29, 2023 06:25
Show Gist options
  • Save dzungtran/c0bc39f57db02c564596096ba3c4872a to your computer and use it in GitHub Desktop.
Save dzungtran/c0bc39f57db02c564596096ba3c4872a to your computer and use it in GitHub Desktop.
Install specify version for protoc-gen-go
GIT_TAG='v1.1.0'
go get -d -u github.com/golang/protobuf/protoc-gen-go
git -C "$(go env GOPATH)"/src/github.com/golang/protobuf checkout $GIT_TAG
go install github.com/golang/protobuf/protoc-gen-go

Check current protoc-gen-go location

which protoc-gen-go

If this file localted in /usr/local/bin/ not in $GOPATH/bin.

Let's remove or uninstall current version of protoc-gen-go by:

brew uninstall protoc-gen-go 
// or just 
sudo rm /usr/local/bin/protoc-gen-go

Then restart terminal

@indexjoseph
Copy link

This was very helpful. thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment