Under Mac, protoc-gen-go-grpc: program not found or is not executable problem solution

a question source

      In the company's project, it is necessary to generate the corresponding pb file from the corresponding proto file. When the protocrelevant 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:


insert image description here

      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-grpcit 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-grpcthis plug-in. The general command to execute is as follows:


go get google.golang

Guess you like

Origin blog.csdn.net/whq19890827/article/details/128008856