Prerequisites:
- Go development environment installed.
$GOPATH/bin
- I tend to use git bash on my command line, so even though these notes are for Windows, the command line examples have a Unix flavour.
- The directory names suit my Windows development machine, on which I have a D drive that I use for most of my development work.
Downloads are at https://github.com/google/protobuf/releases. A binary package for win32 is available.
Unzip at D:\Programs\protobuf
Add D:\Programs\protobuf\bin
to the path.
$ protoc --version
libprotoc 3.5.1
go get -u github.com/golang/protobuf/protoc-gen-go
If you want to use GRPC Gateway for a REST to GRPC reverse proxy:
go get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway
go get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger
go: module github.com/golang/protobuf is deprecated: Use the "google.golang.org/protobuf" module instead.