代码如下:
然后运行
go mod init
go mod download
之后提示报错
go: finding module for package go.etcd.io/etcd/clientv3
go: downloading go.etcd.io/etcd v0.5.0-alpha.5
code.golangstudy.com/project_01/week_07/08_etcd_demo imports
go.etcd.io/etcd/clientv3: go.etcd.io/etcd@v0.5.0-alpha.5: verifying module: go.etcd.io/etcd@v0.5.0-alpha.5: initializing sumdb.Client: reading tree note: malformed note
note:
go.sum database tree
1298033
0LtF5VP3nnoskEJIW2Ko1VFSjqiSgFk8e2B2R6fPWc4=
— sum.golang.org Az3grklwx3YP6nrQjFEYtjYzqN7Tyju8aCtl7FPL/lYL686BgXdAtogOH6O48kBIEYTFFTmais4s0hFatq8UIsFlKQw=
有人说使用
go mod edit -replace github.com/coreos/bbolt@v1.3.4=go.etcd.io/bbolt@v1.3.4
或者手动在go,mod中写require但是都无济于事,我怀疑根本就没有到读go.mod中内容那一步,就已经终止了
go mod模块已经开启,用了很久了都没问题
求大神帮助,这是什么问题呀~~
有疑问加站长微信联系(非本文作者)