gomod使用etcd和grpc版本冲突解决

  |   0 评论   |   0 浏览

etcd/clientv3版本错误

go.mod 目录下执行 go mod tidy报错

/etcd imports
        github.com/coreos/etcd/clientv3 tested by
        github.com/coreos/etcd/clientv3.test imports
        github.com/coreos/etcd/auth imports
        github.com/coreos/etcd/mvcc/backend imports
        github.com/coreos/bbolt: github.com/coreos/bbolt@v1.3.5: parsing go.mod:
        module declares its path as: go.etcd.io/bbolt
                but was required as: github.com/coreos/bbolt

修改gomod

go mod edit -replace github.com/coreos/bbolt@v1.3.4=go.etcd.io/bbolt@v1.3.4

grpc版本错误

imports
        google.golang.org/grpc/naming: module google.golang.org/grpc@latest found (v1.32.0), but does not contain package google.golang.org/grpc/naming

修改gomod

go mod edit -replace google.golang.org/grpc@v1.32.0=google.golang.org/grpc@v1.26.0

重新下载

go mod tidy

问题解决!!!fuck


标题:gomod使用etcd和grpc版本冲突解决
作者:疲惫的怪神明