其他分享
首页 > 其他分享> > golang使用etcd以及go-micro时 clientv3 报错

golang使用etcd以及go-micro时 clientv3 报错

作者:互联网

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

解决办法

一、

在你项目的go.mod中添加

replace google.golang.org/grpc => google.golang.org/grpc v1.26.0

二、

修改依赖为v1.26.0

go mod edit -require=google.golang.org/grpc@v1.26.0

下载v1.26.0版本的grpc

go get -u -x google.golang.org/grpc@v1.26.0

标签:clientv3,..,balancer,golang,报错,etcd,go,mod
来源: https://blog.csdn.net/qq_44205272/article/details/111993813