Protobuf - Protocol Buffer Compiler Installation

发布时间 2023-11-14 19:29:25作者: ZhangZhihuiAAA
$ apt install -y protobuf-compiler

 

To generate source code from .proto files, first install protoc, the protocol buffer compiler (https://grpc.io/docs/protoc-installation/). Then install two more modules to help protoc generate source code specific to the Go language:

zzh@ZZHPC:/zdata/MyPrograms/Go/study$ go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
go: downloading google.golang.org/protobuf v1.31.0
zzh@ZZHPC:/zdata/MyPrograms/Go/study$ go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
go: downloading google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.3.0
go: downloading google.golang.org/grpc v1.59.0
go: downloading google.golang.org/protobuf v1.28.1