gpt4 book ai didi

go - “go.etcd.io/etcd/clientv3/balancer/picker”-未定义的: balancer. PickOptions

转载 作者:行者123 更新时间:2023-12-01 20:25:10 24 4
gpt4 key购买 nike

我在golang中遇到以下错误

# go.etcd.io/etcd/clientv3/balancer/picker                                                   
/home/user/go/src/go.etcd.io/etcd/clientv3/balancer/picker/err.go:37:44: undefined: balancer.PickOptions
/home/user/go/src/go.etcd.io/etcd/clientv3/balancer/picker/roundrobin_balanced.go:55:54:
undefined: balancer.PickOptions
# go.etcd.io/etcd/clientv3/balancer/resolver/endpoint
/home/user/go/src/go.etcd.io/etcd/clientv3/balancer/resolver/endpoint/endpoint.go:114:78:
undefined: resolver.BuildOption
/home/user/go/src/go.etcd.io/etcd/clientv3/balancer/resolver/endpoint/endpoint.go:183:31:
undefined: resolver.ResolveNowOption

我试过了
go get -u google.golang.org/grpc

但仍然遇到同样的问题。我的grpc版本是v1.26.0

有什么办法吗?

最佳答案

您确定您的版本是v1.26.0吗?
您可以分享您的go.mod吗?

go get -u google.golang.org/grpc



上面的命令是检索grpc的最新版本,即 v1.27.1
一旦您从以下位置更改 go.mod中的版本
google.golang.org/grpc v1.27.0


google.golang.org/grpc v1.26.0

您将需要运行以下命令来锁定版本:
go get google.golang.org/grpc@v1.26.0

关于go - “go.etcd.io/etcd/clientv3/balancer/picker”-未定义的: balancer. PickOptions,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60502525/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com