无法安装 protoc-gen-go

转载自 https://blog.csdn.net/qq_16077549/article/details/106037049

最近从java转go学习grpc过程中,由于要使用用protoc和protoc-gen-go,所以在安装相关grpc环境中出现了一些坑,这里给各位刚入门的
朋友分享下,避免踩坑

安装protoc-gen-go

1.go get -u github.com/golang/protobuf/protoc-gen-go

然后就出现了一堆错误

package google.golang.org/protobuf/compiler/protogen: unrecognized import path "google.golang.org/protobuf/compiler/protogen" (https fetch: Get https://google.golang.org/protobuf/compiler/protogen?go-get=1: dial tcp 216.239.37.1:443: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.)
  • 1

what fuck? 为什么down不下来?
难道protoc-gen-go更新了?
看了相关issue之后发现了问题,
然后果断get老版本:

go get -u github.com/golang/protobuf/[email protected]
  • 1

成功搞定

你可能感兴趣的:(golang,golang)