我建议使用基于清单的方法与版本约束。

Project A == Manifest
             |- Repo A@~1.0.1
             |- Repo B@~1.0.1

Repo A == Manifest
             |- Repo C@~1.0.1

Repo B == Manifest
             |- Repo C@~1.0.5

Repo C == Manifest empty

哪个会解决

Project A == Resolved Manifest
             |- Repo A@1.0.1
             |- Repo B@1.0.1
             |- Repo C@1.0.5
~1.0.1>=1.0.1 <1.1.0

如您所见,B和A对C的依赖是独立的,但在项目中它们是正确解析的。

如果A和B将定义与C的不兼容依赖性,则应该发生错误,因为项目不应该是可构建的。

^^1.0.1>=1.0.1 < 2.0.0

请注意,您不必使用诸如代字号和插入符号之类的“助手”,您可以定义显式版本范围。

鉴于您给予远程作者正确升级其版本号的置信度,您应决定应用哪个约束。

最后,您可以使用滑动为您解决这个问题。

glide initgit commit -am 'glide init'git push
glide initglide get git@repo.com/repocgit commit -am 'glide init'glide get git@repo.com/repocgit commit -am 'glide init'git push
glide initglide get git@repo.com/repocgit commit -am 'glide init'glide get git@repo.com/repocgit commit -am 'glide init'git push
glide initglide get git@repo.com/repoagit commit -am 'glide init'glide get git@repo.com/repoaglide get git@repo.com/repobgit commit -am 'glide init'glide get git@repo.com/repobgit commit -am 'glide init'git push
glide installgo build

没有什么可以阻止您使用其vendor文件夹来压缩ProjectA,以便在执行远程安装时跳过glide install命令。

vendor/.gitignoreglide installglide update

在开始期待一些困难,通过那一步,事情会奏效。

一旦您跳转到该工作流程,请注意您必须对您的回购中的每个更改进行修改。

go getgo

最后,你可能想要使用版本保险杠来帮助你快速,快速地完成它,它发生了我为我个人使用做了一个 。

希望这可以帮助。