Unable to build protobuf to go endpoint

后端 未结 12 789
日久生厌
日久生厌 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 12:59

    I met the same problem.

    $ protoc --go_out=plugins=grpc:pb/ *.proto
    protoc-gen-go: program not found or is not executable
    --go_out: protoc-gen-go: Plugin failed with status code 1.
    

    The solution as below:

    Find the installation directory of protoc-gen-go, it must be in your $PATH.

    export PATH=$PATH:/path/to/dir
    

    You'd better add it to your .bash_profile

    echo $"export PATH=\$PATH:$(/path/to/dir)" >> ~/.bash_profile
    source ~/.bash_profile
    

    then everything is ok.

提交回复
热议问题