- MacOs
brew install protobuf
- Linux
$ curl -OL https://github.com/google/protobuf/releases/download/v3.5.1/protoc-3.5.1-linux-x86_64.zip
$ unzip protoc-3.5.1-linux-x86_64.zip -d protoc3
$ sudo mv protoc3/bin/* /usr/local/bin/
$ sudo mv protoc3/include/* /usr/local/include/
$ sudo chown [user] /usr/local/bin/protoc
$ sudo chown -R [user] /usr/local/include/google
Compile proto file
$ protoc hello/hello.proto --go_out=plugins=grpc:.
- Server
$ gor hello/server/server.go
- Client
$ gor hello/client/client.go