Golang  grpc protoc  

使用make生成PB文件时

make gen service=demo-service

底层使用的是:

buf generate demo-service -v

出现以下错误 

Failure: failed to generate plugins concurrently: failed to create handler: could not find protoc plugin for name go

make: *** [gen] Error 1

 解决方案

export PATH=$PATH:$HOME/go/bin
export PATH=$PATH:/usr/local/go/bin

参考如下:

My problem was fixed after adding both GOPATH and GOROOT in PATH as @neild said.

use :


export PATH=$PATH:$HOME/go/bin, in order to add the GOPATH and
export PATH=$PATH:/usr/local/go/bin, in order to add GOROOT