Unable to build protobuf to go endpoint

后端 未结 12 796
日久生厌
日久生厌 2021-01-30 12:39

using protobuf version 2.6.1 ( which i installed via homebrew)

I am trying to run

$ protoc --go_out=../cloud/ *.proto

I keep receiv

12条回答
  •  梦毁少年i
    2021-01-30 13:04

    Directly from grpc documentation:

    Go plugins for the protocol compiler:

    Install the protocol compiler plugins for Go using the following commands:

    $ export GO111MODULE=on  # Enable module mode
    $ go get google.golang.org/protobuf/cmd/protoc-gen-go \
             google.golang.org/grpc/cmd/protoc-gen-go-grpc
    

    Update your PATH so that the protoc compiler can find the plugins:

    $ export PATH="$PATH:$(go env GOPATH)/bin"
    

提交回复
热议问题