Unable to build protobuf to go endpoint

后端 未结 12 781
日久生厌
日久生厌 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条回答
  •  北海茫月
    2021-01-30 13:02

    1. You should properly define your GO_PATH - where your go packages live. In other words, GO_PATH is your go workspace. The GO_PATH should be ~/go.

    2. protoc-gen-go should be in your PATH. While protoc-gen-go lives in $GO_PATH/bin after you installed it.


    Add these 2 important lines to your ~/.bash_profile:

    export GO_PATH=~/go
    export PATH=$PATH:/$GO_PATH/bin
    

    Then you need to start a new shell session or just type in this line:

    $ source ~/.bash_profile
    

提交回复
热议问题