美文网首页
golang 安装etcd clientv3 报错

golang 安装etcd clientv3 报错

作者: 崔天浩 | 来源:发表于2020-03-29 21:00 被阅读0次

    报错1

    go  get  go.etcd.io/etcd/clientv3
    go: finding github.com/coreos/go-systemd/journal latest
    go: finding github.com/coreos/go-systemd latest
    go: finding github.com/gogo/protobuf v1.2.1
    build command-line-arguments: cannot load github.com/coreos/go-systemd/journal: no matching versions for query "latest"
    

    解决方法

    在你项目的go.mod中添加
    replace github.com/coreos/go-systemd => github.com/coreos/go-systemd/v22 v22.0.0

    报错2

    github.com/coreos/etcd/clientv3/balancer/resolver/endpoint
    ../../pkg/mod/github.com/coreos/etcd@v3.3.18+incompatible/clientv3/balancer/resolver/endpoint/endpoint.go:114:78: undefined: resolver.BuildOption
    ../../pkg/mod/github.com/coreos/etcd@v3.3.18+incompatible/clientv3/balancer/resolver/endpoint/endpoint.go:182:31: undefined: resolver.ResolveNowOption
    # github.com/coreos/etcd/clientv3/balancer/picker
    ../../pkg/mod/github.com/coreos/etcd@v3.3.18+incompatible/clientv3/balancer/picker/err.go:37:44: undefined: balancer.PickOptions
    ../../pkg/mod/github.com/coreos/etcd@v3.3.18+incompatible/clientv3/balancer/picker/roundrobin_balanced.go:55:54: undefined: balancer.PickOptions
    

    解决方法

    在你项目的go.mod中添加
    replace google.golang.org/grpc => google.golang.org/grpc v1.26.0

    相关文章

      网友评论

          本文标题:golang 安装etcd clientv3 报错

          本文链接:https://www.haomeiwen.com/subject/eyfpuhtx.html