using protobuf version 2.6.1 ( which i installed via homebrew)
I am trying to run
$ protoc --go_out=../cloud/ *.proto
I keep receiv
If you're using Fedora, ensure that the package "protoc-gen-go" is installed, and it's binary is in your shel PATH.
$sudo dnf install protoc-gen-go -y
What I did to solve this was:
copy protoc-gen-go from the go bin folder in go workspace to /usr/local/bin/
run your command as before in your case "protoc --go_out=../cloud/ *.proto"
On Ubuntu 18.04, this is verified working to solve this issue:
sudo apt-get install golang-goprotobuf-dev
How I solved:
$GOPATH/bin
to PATH by running
export PATH=$PATH:$GOPATH/bin
export GOPATH=$(go env GOPATH)
above export PATH=$PATH:$GOPATH/bin
line inside the .bash_profile
file.go get -u
for the required packages again.protoc --go_out=../cloud/ *.proto
in your case.Using
$ go get -u github.com/golang/protobuf/{proto,protoc-gen-go}
is more safe than using
$ sudo apt-get install golang-goprotobuf-dev
Because the latest protoc-gen-go
is using the lib github.com/golang/protobuf/proto
, but protoc-gen-go
in apt-get
using the lib code.google.com/p/goprotobuf/proto
which didn't exist now.
Ensure that your path to proton-gen-go
in your PATH
variable is absolute (i.e. /Users/me/go/bin
instead of ~/go/bin
.
Apparently protoc
does not know how to expand ~
.