go get go.etcd.io/etcd/clientv3报错

在go mod 模式下下载模块

go.etcd.io/etcd/clientv3出错:
# github.com/coreos/etcd/clientv3/balancer/picker
F:\Go\pkg\mod\github.com\coreos\etcd@v3.3.22+incompatible\clientv3\balancer\picker\err.go:37:44: undefined: balancer.PickOptions
F:\Go\pkg\mod\github.com\coreos\etcd@v3.3.22+incompatible\clientv3\balancer\picker\roundrobin_balanced.go:55:54: undefined: balancer.PickOptions
# github.com/coreos/etcd/clientv3/balancer/resolver/endpoint
F:\Go\pkg\mod\github.com\coreos\etcd@v3.3.22+incompatible\clientv3\balancer\resolver\endpoint\endpoint.go:114:78: undefined: resolver.BuildOption
F:\Go\pkg\mod\github.com\coreos\etcd@v3.3.22+incompatible\clientv3\balancer\resolver\endpoint\endpoint.go:182:31: undefined: resolver.ResolveNowOption

出错的原因是:

google.golang.org/grpc v1.31.0 // indirect

版本太新了,改为:

google.golang.org/grpc v1.26.0 // indirect

然后重新go get download

 

posted @ 2020-08-12 09:46  胖胖咩  阅读(1537)  评论(0)    收藏  举报