首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >模块声明为X,但被要求为Y

模块声明为X,但被要求为Y
EN

Stack Overflow用户
提问于 2020-02-21 15:17:47
回答 1查看 6.3K关注 0票数 7

我试图在我的模块中使用grafana/grafana/pkg/tsdb包。我不认为这个问题是专门针对地堑的,但下面是这样的:

代码语言:javascript
复制
$ go get -u github.com/grafana/grafana/pkg/tsdb
go: finding github.com/inconshreveable/log15 latest
go: finding github.com/go-macaron/session latest
go: finding golang.org/x/oauth2 latest
go: finding github.com/teris-io/shortid latest
go: github.com/grafana/grafana/pkg/tsdb imports
        github.com/go-xorm/core: github.com/go-xorm/core@v0.6.3: parsing go.mod:
        module declares its path as: xorm.io/core
                but was required as: github.com/go-xorm/core

它说包tsdb将xorm导入为github.com/go-xorm/core,但是模块声明自己为xorm.io/core

看看Grafana的go.mod文件,它正在使用github.com/go-xorm/core,然后转到github.com/go-xorm/core,它说这个项目现在被存档了。它是go.mod文件,实际上声明为xorm.io/core.

以及我如何解决这个问题的建议?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-02-21 16:53:13

编辑:我还很幸运地使用了一个稍微老一点的版本:

代码语言:javascript
复制
go get github.com/grafana/grafana/pkg/tsdb@6.6.1

我尝试了一种替代方法,它有时会起作用:

代码语言:javascript
复制
module foo

replace github.com/go-xorm/core => xorm.io/core v0.6.2

go 1.13

require (
...

但我得到了一个类型错误。

幸运的是,似乎有一个PR解决了这个问题:https://github.com/grafana/grafana/pull/22376

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/60341591

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档