7

我正在尝试grafana/grafana/pkg/tsdb在我的模块中使用包。我不认为这个问题是 grafana 特有的,但它是这样的:

$ 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......

以及有关如何解决此问题的建议?

4

1 回答 1

3

编辑:我也很幸运只是使用了一个稍旧的版本:

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

于 2020-02-21T16:53:13.690 回答