Go-Micro undefined: balancer.PickOptions

Posted Time-Traveler

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Go-Micro undefined: balancer.PickOptions相关的知识,希望对你有一定的参考价值。

# 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 

导致这个问题的原因是grpc的版本,go.mod文件中:

google.golang.org/grpc v1.27.0

而v1.26.0是可以的,修改go.mod中的版本为:

google.golang.org/grpc v1.26.0

执行以下命令:

go get google.golang.org/grpc@v1.26.0

以上是关于Go-Micro undefined: balancer.PickOptions的主要内容,如果未能解决你的问题,请参考以下文章

Go-Micro undefined: balancer.PickOptions

go微服务框架go-micro深度学习-目录

14.Go-micro的装饰器wrapper的初步使用(中间件)

创建go-micro v2项目

Go-Micro框架入门教程---框架结构

4.微服务-go-micro