Unable to build protobuf to go endpoint

后端 未结 12 923
日久生厌
日久生厌 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条回答
  •  Happy的楠姐
    2021-01-30 12:59

    I have Ubuntu 18.04.02 LTS and installed protoc using

    sudo apt install protobuf-compiler
    

    I have my GOPATH and GOBIN set correctly, but still when I did a protoc --go_out=. I was getting

    protoc-gen-go: program not found or is not executable
    --go_out: protoc-gen-go: Plugin failed with status code 1.
    
    

    After reading bunch of places, was able to find that doing

    go get -u github.com/golang/protobuf/protoc-gen-go
    

    was able to fix the issue. Hope this helps someone out there.

提交回复
热议问题