意外的模块路径"github.com/sirupsen/logrus"; [英] Unexpected module path "github.com/sirupsen/logrus"

查看:66
本文介绍了意外的模块路径"github.com/sirupsen/logrus";的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用过"github.com/sirupsen/logrus" ,但我无法删除它

I've used "github.com/sirupsen/logrus" and I can't manage to remove it

我尝试过

进行整洁

去干净-modcache

这是日志:

转到:github.com/Sirupsen/logrus@v1.4.0:解析go.mod:意外的模块路径"github.com/sirupsen/logrus"

我什至删除了 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是一个重大变化;因为在模块模式下,github.com/Sirupsen/logrus的导入路径现在不再起作用(具有讽刺意味的是).因此,我认为github.com/Sirupsen/logrus/github.com/sirupsen/logrus的模块发布实际上应该是v2版本.

github.com/Sirupsen/logrus/github.com/sirupsen/logrus is a breaking change; because an import path of github.com/Sirupsen/logrus now no longer works when in module mode (the irony). Hence I think the module release of github.com/Sirupsen/logrus/github.com/sirupsen/logrus should in fact have been a v2 release.

https://github.com/golang/go/issues/28489 https://github.com/golang/go/issues/26208

这篇关于意外的模块路径"github.com/sirupsen/logrus";的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆