代码是:
import (
"context"
"crypto/tls"
"time"
"go.etcd.io/etcd/clientv3"
)
func main(){
...
config := clientv3.Config{}
config.Username = u.username
...
}
go.mod 文件
module github.com/xxx
go 1.17
require (
github.com/coreos/etcd v2.3.8+incompatible // indirect
go.etcd.io/etcd v2.3.8+incompatible // indirect
)
它失败并显示此消息:
config.Username undefined (type clientv3.Config has no field or method Username)
有没有办法解决这个问题?github.com/coreos/etcd/clientv3和go.etcd.io/etcd有什么区别?</p>