1
1

More than 3 years have passed since last update.

Goのetcd clientを使っているときにundefined: balancer.PickOptionsエラーが発生する場合の解消方法

Last updated at Posted at 2020-06-15

エラー内容

undefined: balancer.PickOptions以外にも、undefined: resolver.BuildOptionや、undefined: ResolveNowOptionも同時に発生する場合がある。

# github.com/coreos/etcd/clientv3/balancer/picker
/home/reoring/go/pkg/mod/github.com/coreos/etcd@v3.3.22+incompatible/clientv3/balancer/picker/err.go:37:44: undefined: balancer.PickOptions
/home/reoring/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
/home/reoring/go/pkg/mod/github.com/coreos/etcd@v3.3.22+incompatible/clientv3/balancer/resolver/endpoint/endpoint.go:114:78: undefined: resolver.BuildOption
/home/reoring/go/pkg/mod/github.com/coreos/etcd@v3.3.22+incompatible/clientv3/balancer/resolver/endpoint/endpoint.go:182:31: undefined: resolver.ResolveNowOption

解決方法

etcdのバージョンを落とす。この場合は3.3.13まで落とすと上記エラーは発生しない。

go get go.etcd.io/etcd@v3.3.13+incompatible
go get github.com/coreos/etcd@v3.3.13+incompatible
1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1