1、安装micro

需要使用GO1.11以上版本

#linux 下
export GO111MODULE=on
export GOPROXY=https://goproxy.cn
# 使用如下指令安装
go get -u -v github.com/micro/micro
go get -u -v github.com/micro/go-micro

2、安装protoc

参考文章见https://www.cnblogs.com/Dong-Ge/p/11463386.html

3、安装protoc-gen-micro

先安装golang依赖库

cd $GOPATH/src/golang.org/x
git clone https://github.com/golang/net.git
git clone https://github.com/golang/crypto.git
git clone https://github.com/golang/text.git

安装protoc-gen-micro

go get github.com/micro/protoc-gen-micro

4、最后安装micro

go get github.com/micro/micro

5、生成micro文件

protoc --plugin=protoc-gen-go=$GOPATH/bin/protoc-gen-go --plugin=protoc-gen-micro=$GOPATH/bin/protoc-gen-micro --proto_path=$GOPATH/src:. --micro_out=. --go_out=. *.proto

 

相关文章:

  • 2021-05-16
  • 2021-10-03
  • 2022-02-27
  • 2021-10-09
  • 2022-12-23
  • 2022-12-23
  • 2021-09-08
  • 2020-03-27
猜你喜欢
  • 2021-11-30
  • 2021-11-23
  • 2023-01-07
  • 2021-08-18
  • 2018-07-20
  • 2023-01-08
相关资源
相似解决方案