protoc-gen-go-http: 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-http_out: protoc-gen-go-http: Plugin failed with status code 1.
- 解决(确保
protoc
protoc-gen-go
已正确安装并全局可访问):
export GOPATH=$HOME/go
PATH=$PATH:$GOPATH/bin
- 安装记录(macOs M1):
brew install protobuf
-
proto-gen-go
上官网下载最新版后mv proto-gen-go /usr/local/bin
(这一步只是移动可执行文件,根据自己下载的位置来) - 碰到依赖无法下载超时,看到提示的ip跟域名后尝试修改
hosts
:sudo vi /etc/hosts
:
185.199.108.133 raw.githubusercontent.com 185.199.109.133 raw.githubusercontent.com 185.199.110.133 raw.githubusercontent.com 185.199.111.133 raw.githubusercontent.com # Added by Docker Desktop # To allow the same kube context to work on the host and the container: 127.0.0.1 kubernetes.docker.internal # End of section 142.251.43.17 proxy.golang.org 172.217.160.81 google.golang.org 140.82.113.4 github.com