简体   繁体   English

意外的模块路径“github.com/sirupsen/logrus”

[英]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.

相关问题 不区分大小写的导入冲突:“ github.com/sirupsen/logrus”和“ github.com/Sirupsen/logrus” - case-insensitive import collision: “github.com/sirupsen/logrus” and “github.com/Sirupsen/logrus” 如何解决gomod:`github.com/stretchrcom/testify@v1.4.0:解析go.mod:意外的模块路径“github.com/stretchr/testify”` - How to fix gomod: `github.com/stretchrcom/testify@v1.4.0: parsing go.mod: unexpected module path “github.com/stretchr/testify”` /vendor/github.com/weaveworks/promrus 上的 golang 构建给出了一个错误:未定义:logrus.Level - golang build at /vendor/github.com/weaveworks/promrus is giving an error: undefined: logrus.Level github.com/golang/protobuf/protoc-gen-go 没有 golang 版本 1.18 的 package 路径 - github.com/golang/protobuf/protoc-gen-go has no package path for golang version 1.18 找不到https://github.com/mbanzon/simplehttp golang模块。 哪里去了? - Could not found https://github.com/mbanzon/simplehttp golang module. Where it has gone? 没有必需的模块提供包 github.com/aws/aws-sdk-go/aws - no required module provides package github.com/aws/aws-sdk-go/aws 无法构建 github.com/jonpchin/gochess - “工作目录不是模块的一部分” - Cannot build github.com/jonpchin/gochess - “working directory is not part of a module” 在golang中实现github.com/jlaffaye/ftp - implement github.com/jlaffaye/ftp in golang 如何在 Windows 中使用 github.com/AllenDang/giu 和 github.com/gordonklaus/portaudio 构建 GO 程序 - how to build a GO program using github.com/AllenDang/giu and github.com/gordonklaus/portaudio in Windows 去上叉的github仓库得到“意外的模块路径”错误 - go get on forked github repo got “unexpected module path” error
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM