a question source
In the company's project, it is necessary to generate the corresponding pb file from the corresponding proto file. When the protoc
relevant command is executed, an error occurs: protoc-gen-go-grpc: program not found or is not executable Please specify a program using absolute path or make sure the program is available in your PATH system variable --go-grpc_out: protoc-gen-go-grpc: Plugin failed with status code 1.
as shown in the following figure:
The consequence is that the corresponding pb file is not generated!
Two causes and solutions
The reason for this problem, simply put, is that protoc-gen-go-grpc
it has not been installed, and when the script is executed, the corresponding plug-in cannot be found to handle it.
I found the corresponding problem on the Internet and read a lot of articles. The solution is to install protoc-gen-go-grpc
this plug-in. The general command to execute is as follows:
go get google.golang