今天领导临时要求将项目从restful转换成grpc,在mac上弄了一下午始终无法生成pb文件,最后才发现mac的环境变量内没有$GOPATH/bin
# 安装 brew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# 安装 protobuf
brew install protobuf
#安装proto,protoc-gen-go
go get github.com/golang/protobuf/proto
go get github.com/golang/protobuf/protoc-gen-go
export GOPATH [your gopathd]
export GOPATH/bin
网友评论