[英]Unexpected module path “github.com/sirupsen/logrus”
I've used "github.com/sirupsen/logrus"
and I can't manage to remove it 我使用过
"github.com/sirupsen/logrus"
,我无法将其删除
I've tried 我试过了
go mod tidy
go clean -modcache
This is the log: 这是日志:
go: github.com/Sirupsen/logrus@v1.4.0: parsing go.mod: unexpected module path "github.com/sirupsen/logrus"
I've even deleted the mod
directory. 我甚至删除了
mod
目录。
I've found the solution: 我找到了解决方案:
I've replace in go.mod
我在
go.mod
替换了
replace (
github.com/Sirupsen/logrus v1.3.0 => github.com/Sirupsen/logrus v1.0.6
github.com/Sirupsen/logrus v1.4.0 => github.com/sirupsen/logrus v1.0.6
github.com/Sirupsen/logrus v1.0.5 => github.com/sirupsen/logrus v1.0.5
)
github.com/Sirupsen/logrus/github.com/sirupsen/logrus is a breaking change; github.com/Sirupsen/logrus/github.com/sirupsen/logrus是一个重大改变; because an import path of github.com/Sirupsen/logrus now no longer works when in module mode (the irony).
因为github.com/Sirupsen/logrus的导入路径现在在模块模式下不再有效(具有讽刺意义)。 Hence I think the module release of github.com/Sirupsen/logrus/github.com/sirupsen/logrus should in fact have been a v2 release.
因此,我认为github.com/Sirupsen/logrus/github.com/sirupsen/logrus的模块版本实际上应该是v2版本。
https://github.com/golang/go/issues/28489 https://github.com/golang/go/issues/26208 https://github.com/golang/go/issues/28489 https://github.com/golang/go/issues/26208
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.