https://grpc.io/docs/languages/go/quickstart/
Make sure gopath has been setup and added to path
export PATH="$PATH:$(go env GOPATH)/bin"
https://github.com/protocolbuffers/protobuf/releases https://grpc.io/docs/protoc-installation/
curl -OL https://github.com/protocolbuffers/protobuf/releases/download/v3.17.3/protoc-3.17.3-osx-x86_64.zip \
&& unzip -o protoc-3.17.3-osx-x86_64.zip -d /usr/local/bin/protoc \
&& unzip -o protoc-3.17.3-osx-x86_64.zip -d /usr/local/include/*' \
&& rm -f protoc-3.17.3-osx-x86_64.zip
verify protoc
installation
protoc --version
Protobuf support go programming language https://github.com/protocolbuffers/protobuf-go in package google.golang.org/protobuf
ProtoBuf/protoc compiler
plugins for code generator
Protocol buffer
compiler
requires a plugin to generate code
https://grpc.io/docs/languages/go/quickstart/
# The protocol buffer `compiler` requires a plugin to generate Go code
go get google.golang.org/protobuf/cmd/[email protected]
# The protocol buffer `compiler` requires a plugin to generate grpc Go code
go get google.golang.org/grpc/cmd/[email protected]
cd helloword
# after changes in helloworld.proto
protoc --go_out=. --go_opt=paths=source_relative \
--go-grpc_out=. --go-grpc_opt=paths=source_relative \
helloworld/helloworld.proto
go run greeter_server/main.go
go run greeter_client/main.go