Protobuf in Go
suggest changeIntroduction
Protobuf, or Protocol Buffers, encodes and decodes structured data so that programs written in different languages can exchange messages. The generated code serializes a message to a compact binary form and decodes that form at the other end.
Remarks
There are two steps to using protobuf.
- Compile the protocol buffer definitions.
- Import the generated code, with the support library, into your program.
gRPC support
If a proto file specifies RPC services, generate the gRPC stubs with the separate protoc-gen-go-grpc plugin. The older plugins=grpc option on protoc-gen-go is no longer accepted:
$ protoc --go_out=. --go-grpc_out=. *.proto
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents