首先安装gateway环境
1.依次安装下列框架
go get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway
go get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger
go get -u github.com/golang/protobuf/protoc-gen-go
对于win系统,在安装包后,有时在执行protoc命令时候出现执行文件找不到错误,就需要:
go install github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway
go install github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger
go install github.com/golang/protobuf/protoc-gen-go
执行上面命令,就会在GOPATH/bin下生成对应的二进制执行文件
网友评论