0%

搭建Golang微服务开发环境

安装Golang

安装Protocbuf

安装 Protobuf 插件

  • protoc-gen-go

    1
    2
    3
    4
    go get github.com/golang/protobuf/protoc-gen-go

    protoc --go_out=. myproto.proto
    protoc --go_out=plugins=grpc:. *.proto
  • protoc-gen-gofast

    1
    2
    3
    4
    go get github.com/gogo/protobuf/protoc-gen-gofast

    protoc --gofast_out=. myproto.proto
    protoc --gofast_out=plugins=grpc:. *.proto