zt3ff3n 发表于 2022-5-11 14:51

protoc 及插件安装步骤

项目中安装 grpc

go get google.golang.org/grpc
安装 protoc

https://github.com/protocolbuffers/protobuf/releases/

将相应软件下载下来, 然后将 bin 文件夹添加到 $PATH
安装

protoc-gen-go

go install google.golang.org/protobuf/cmd/protoc-gen-go

protoc-gen-go-grpc

go install google.golang.org/grpc/cmd/protoc-gen-go-grpc

protoc-gen-grpc-gateway

go install github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway

protoc-gen-swagger

go install github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger
安装

go-bindata

go install github.com/jteeuwen/go-bindata/...

go-bindata-assetfs

go install github.com/elazarl/go-bindata-assetfs/...
配置路径, install 的文件会安装在 GOPATH/bin下,所以将GOPATH/bin配置到$PATH
页: [1]
查看完整版本: protoc 及插件安装步骤