Skip to content

Instantly share code, notes, and snippets.

@paulodutra
Last active December 15, 2022 14:09
Show Gist options
  • Save paulodutra/997c941eec56e3d1c7e94b2a8f7ef0d0 to your computer and use it in GitHub Desktop.
Save paulodutra/997c941eec56e3d1c7e94b2a8f7ef0d0 to your computer and use it in GitHub Desktop.
golang installation with protocol buffter compiler and plugins for working gRPC with golang
1. First make the download the Go installer: curl -k https://go.dev/dl/go1.19.4.linux-amd64.tar.gz -o go.1.19.14.linux-amd64.tar.gz
2. You need remove any previous Go installation (if it exists), and then extract the file downloaded before: rm -rf /usr/local/go && tar -C /usr/local -xzf go1.19.4.linux-amd64.tar.gz
3. Add the go PATH in PATH environment variable: export PATH=$PATH:/usr/local/go/bin
4. Open the profile file: vim ~/.profile
5. In the end profile file add the go PATH: PATH=$PATH:/usr/local/go/bin
6. Install de protocol buffter compiler: apt install protobuf-compiler
7. Install the go plugins for working with gRPC:
go install google.golang.org/protobuf/cmd/[email protected]
go install google.golang.org/grpc/cmd/[email protected]
8. Update your PATH with protoc complier can find the plugins:
export PATH="$PATH:$(go env GOPATH)/bin"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment