linux使用go连接etcd集群时报错:
# github.com/coreos/etcd/clientv3/balancer/resolver/endpoint /root/go/pkg/mod/github.com/coreos/[email protected]+incompatible/clientv3/balancer/resolver/endpoint/endpoint.go:114:87: undefined: resolver.BuildOption /root/go/pkg/mod/github.com/coreos/[email protected]+incompatible/clientv3/balancer/resolver/endpoint/endpoint.go:115:16: target.Authority undefined (type resolver.Target has no field or method Authority) /root/go/pkg/mod/github.com/coreos/[email protected]+incompatible/clientv3/balancer/resolver/endpoint/endpoint.go:118:15: target.Authority undefined (type resolver.Target has no field or method Authority) /root/go/pkg/mod/github.com/coreos/[email protected]+incompatible/clientv3/balancer/resolver/endpoint/endpoint.go:182:40: undefined: resolver.ResolveNowOption # github.com/coreos/etcd/clientv3/balancer/picker /root/go/pkg/mod/github.com/coreos/[email protected]+incompatible/clientv3/balancer/picker/err.go:37:53: undefined: balancer.PickOptions /root/go/pkg/mod/github.com/coreos/[email protected]+incompatible/clientv3/balancer/picker/roundrobin_balanced.go:55:63: undefined: balancer.PickOptions
解决方法:
修改go.mod中grpc的版本为v1.26.0
google.golang.org/grpc v1.26.0 // indirect
再执行下面的命令就可以了
go mod edit -require=google.golang.org/[email protected] go get -u -x google.golang.org/[email protected]
标签:clientv3,github,resolver,balancer,endpoint,etcd,go From: https://www.cnblogs.com/Xinenhui/p/17719884.html