安装前环境变量设置GOPROXY:export GOPROXY="https://goproxy.io,direct"

protobuf安装指定版本

解压到目录依次执行:./configure,make -j6 && make install

2、homebrew安装方式(mac M1):arch -arm64 brew install protobuf

查看版本:protoc --version

protoc-gen-go

1、go install google.golang.org/protobuf/cmd/protoc-gen-go@latest

protoc-gen-grpc-gateway

1、go install github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway@latest

protoc-gen-go-grpc

1、go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest