Go-Micro启动依赖报错解决方法

Go-Micro启动依赖报错解决方法
强烈推介IDEA2020.2破解激活,IntelliJ IDEA 注册码,2020.2 IDEA 激活码

1.依赖报错内容

# github.com/coreos/etcd/clientv3/balancer/picker
D:\GoPath\pkg\mod\github.com\coreos\etcd@v3.3.25+incompatible\clientv3\balancer\picker\err.go:37:44: undefined: balancer.PickOptions
D:\GoPath\pkg\mod\github.com\coreos\etcd@v3.3.25+incompatible\clientv3\balancer\picker\roundrobin_balanced.go:55:54: undefined: balancer.PickOptions
# github.com/coreos/etcd/clientv3/balancer/resolver/endpoint
D:\GoPath\pkg\mod\github.com\coreos\etcd@v3.3.25+incompatible\clientv3\balancer\resolver\endpoint\endpoint.go:114:78: undefined: resolver.BuildOption
D:\GoPath\pkg\mod\github.com\coreos\etcd@v3.3.25+incompatible\clientv3\balancer\resolver\endpoint\endpoint.go:182:31: undefined: resolver.ResolveNowOption
# github.com/micro/go-micro/transport/quic
D:\GoPath\pkg\mod\github.com\micro\go-micro@v1.18.0\transport\quic\quic.go:54:12: q.s.Close undefined (type quic.Session has no field or method Close)
D:\GoPath\pkg\mod\github.com\micro\go-micro@v1.18.0\transport\quic\quic.go:121:3: unknown field 'IdleTimeout' in struct literal of type quic.Config

Compilation finished with exit code 2

2.解决方法

replace (
	github.com/lucas-clemente/quic-go => github.com/lucas-clemente/quic-go v0.14.1
	google.golang.org/grpc => google.golang.org/grpc v1.26.0
)

另外 go-micro 框架只能运行在 go 1.13 ~ 1.14版本,所以安装最新 1.15 的还有个报错,降低版本到1.14即可。

本文来源MrKorbin,由架构君转载发布,观点不代表Java架构师必看的立场,转载请标明来源出处:https://javajgs.com/archives/25248

发表评论