我试图在我的模块中使用grafana/grafana/pkg/tsdb包。我不认为这个问题是专门针对地堑的,但下面是这样的:
$ 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.
以及我如何解决这个问题的建议?
发布于 2020-02-21 16:53:13
编辑:我还很幸运地使用了一个稍微老一点的版本:
go get github.com/grafana/grafana/pkg/tsdb@6.6.1我尝试了一种替代方法,它有时会起作用:
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
https://stackoverflow.com/questions/60341591
复制相似问题