Quick start & environment configuration
- Go to download release for the platform. Should be an archive. Unzip and make sure the
bin/
directory from the content is added to the systemPATH
variableprotoc --version
- Install GO Plugins for the protocol compiler:
$ go install google.golang.org/protobuf/cmd/[email protected] $ go install google.golang.org/grpc/cmd/[email protected]
- For
go-micro
framework, additionaly downloadmicro-generator
$ go install github.com/go-micro/generator/cmd/protoc-gen-micro@latest
- Update the your
PATH
by adding theGOPATH
(temporarily or permenantly)$ export PATH="$PATH:$(go env GOPATH)/bin"
And you should be able to use following command to generate pb.go & micro.pb.go
protoc --micro_out=. --go_out=. -I=./proto
- Add makefile for quick batch generating proto files to individual directories