如何解决损坏的Go间接依赖关系?

huangapple go评论86阅读模式
英文:

How to resolve broken go indirect dependency?

问题

我有一个项目,其中使用了github.com/datawire/ambassador@v1.14.0,由于ambassador更新了仓库名称,我已经相应地进行了更改。但是在没有任何修改的情况下,出现了以下错误:

执行go mod tidy命令后的错误信息如下:

go: github.com/datawire/ambassador@v1.14.0 需要
        helm.sh/helm/v3@v3.5.3 需要
        github.com/deislabs/oras@v0.10.0 需要
        github.com/docker/distribution@v0.0.0-00010101000000-000000000000: 无效的版本: 未知的修订版本 000000000000

作为一个新手,我无法解决这个问题。

英文:

As I have a project that has github.com/datawire/ambassador@v1.14.0, since the ambassador updated repo name I have changed accordingly.
Without any modification the error looks:

go mod tidy

go: github.com/datawire/ambassador@v1.14.0 requires
        helm.sh/helm/v3@v3.5.3 requires
        github.com/deislabs/oras@v0.10.0 requires
        github.com/docker/distribution@v0.0.0-00010101000000-000000000000: invalid version: unknown revision 000000000000

As a new go learner, I couldn't figure out how to solve it.

答案1

得分: 0

请将以下内容添加到go.mod文件中:

replace (
    github.com/docker/distribution => github.com/docker/distribution v0.0.0-20191216044856-a8371794149d
    github.com/docker/docker => github.com/moby/moby v17.12.0-ce-rc1.0.20200618181300-9dc6525e6118+incompatible
)
英文:

Add the following lines in to go.mod file

replace (
	github.com/docker/distribution => github.com/docker/distribution v0.0.0-20191216044856-a8371794149d
	github.com/docker/docker => github.com/moby/moby v17.12.0-ce-rc1.0.20200618181300-9dc6525e6118+incompatible
)

huangapple
  • 本文由 发表于 2021年8月23日 22:24:33
  • 转载请务必保留本文链接:https://go.coder-hub.com/68894383.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定