clientv3 github.com与go.etcd.io冲突 /github.com/coreos/etcd/clientv3/auth.go:166:106: too many errors

编译出现下面错误,
github.com/coreos/etcd/clientv3
…/github.com/coreos/etcd/clientv3/auth.go:121:72: cannot use auth.callOpts (type []“github.com/coreos/etcd/vendor/google.golang.org/grpc”.CallOption) as type []“go.etcd.io/etcd/vendor/google.golang.org/grpc”.CallOption in argument to auth.remote.AuthEnable
…/github.com/coreos/etcd/clientv3/auth.go:126:74: cannot use auth.callOpts (type []“github.com/coreos/etcd/vendor/google.golang.org/grpc”.CallOption) as type []“go.etcd.io/etcd/vendor/google.golang.org/grpc”.CallOption in argument to auth.remote.AuthDisable
…/github.com/coreos/etcd/clientv3/auth.go:131:152: cannot use auth.callOpts (type []“github.com/coreos/etcd/vendor/google.golang.org/grpc”.CallOption) as type []“go.etcd.io/etcd/vendor/google.golang.org/grpc”.CallOption in argument to auth.remote.UserAdd
…/github.com/coreos/etcd/clientv3/auth.go:136:144: cannot use auth.callOpts (type []“github.com/coreos/etcd/vendor/google.golang.org/grpc”.CallOption) as type []“go.etcd.io/etcd/vendor/google.golang.org/grpc”.CallOption in argument to auth.remote.UserAdd
…/github.com/coreos/etcd/clientv3/auth.go:141:86: cannot use auth.callOpts (type []“github.com/coreos/etcd/vendor/google.golang.org/grpc”.CallOption) as type []“go.etcd.io/etcd/vendor/google.golang.org/grpc”.CallOption in argument to auth.remote.UserDelete
…/github.com/coreos/etcd/clientv3/auth.go:146:122: cannot use auth.callOpts (type []“github.com/coreos/etcd/vendor/google.golang.org/grpc”.CallOption) as type []“go.etcd.io/etcd/vendor/google.golang.org/grpc”.CallOption in argument to auth.remote.UserChangePassword
。。。。。。。。。。。。。。。
…/github.com/coreos/etcd/clientv3/auth.go:166:106: too many errors

网上找了很多方法都没解决,不过有篇文章说
在import的时候 应该import “go.etcd.io/etcd/clientv3” 而不是 “github.com/coreos/etcd/clientv3”
就可以了,问题是我代码里面没引用,如是我觉得肯定是库里面代码问题,先把引用库代码都找出
敲命令:cd $GOPATH/src 在go工作目录下,然后命令:
grep github.com/coreos/etcd/clientv3 -r ./github.com/micro
clientv3 github.com与go.etcd.io冲突 /github.com/coreos/etcd/clientv3/auth.go:166:106: too many errors_第1张图片
发现很多地方引用:github.com/coreos/etcd/clientv3
用sed批量替换成:go.etcd.io/etcd/clientv3
sed -i ‘s/github.com/coreos/etcd/clientv3/go.etcd.io/etcd/clientv3/g’ grep github.com/coreos/etcd/clientv3 -rl ./github.com/micro
然后问题解决

你可能感兴趣的:(clientv3 github.com与go.etcd.io冲突 /github.com/coreos/etcd/clientv3/auth.go:166:106: too many errors)