debuggoMajor
Error "protoc-gen-go: program not found or is not executable"
Viewed 0 times
errorprogramfoundprotocexecutablenotgen
Problem
I am trying to build a sample application with Go gRPC, but I am unable to generate the code using "protoc"
I have installed the required libraries and Go packages using:
I have tried setting the path as well, but no luck.
Sample "proto" file:
Error message:
"protoc-gen-go: program not found or is not executable
--go_out: protoc-gen-go: Plugin failed with status code 1."
I have installed the required libraries and Go packages using:
go get -u google.golang.org/grpc
go get -u github.com/golang/protobuf/protoc-gen-go
I have tried setting the path as well, but no luck.
Sample "proto" file:
syntax = "proto3";
package greet;
option go_package="greetpb";
service GreetService{}Error message:
"protoc-gen-go: program not found or is not executable
--go_out: protoc-gen-go: Plugin failed with status code 1."
Solution
I resolved it by following these steps:
Install the Go library using:
Reference: Unable to build protobuf to go endpoint
Install the Go library using:
go get -u github.com/golang/protobuf/{proto,protoc-gen-go}
- Run
vim ~/.bash_profile
- Add:
export GO_PATH=~/go
export PATH=$PATH:/$GO_PATH/bin
- Run
source ~/.bash_profile
Reference: Unable to build protobuf to go endpoint
Context
Stack Overflow Q#57700860, score: 62
Revisions (0)
No revisions yet.