使用govendor设置特定的依赖项提交

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

Set specific commit of a dependency with govendor

问题

我正在使用govendor来管理项目中的依赖项。我在我的vendor/vendor.json文件中有以下依赖项。

{
    ...
    "package": [
        {...},
        {
            "checksumSHA1": "8XAGmXqf+b4LW91wsWxa4kH1NN0=",
            "path": "gopkg.in/h2non/bimg.v1",
            "revision": "9bb3ae10c5ce30e72f7ac0834368536fc095d6a7",
            "revisionTime": "2017-01-13T19:35:42Z"
        }
    ],
    ...
}

现在我想使用bimg包的主版本,该版本比govendor获取的1.0.7版本更新。除了手动从GitHub下载主版本并保存到vendor文件夹中,还有其他合适的方法吗?

附注:所有依赖项都已提交。

英文:

I'm using govendor for managing dependencies in a project. I have the following dependency in my vendor/vendor.json.

{
...
"package": [	
    {...},
	{
		"checksumSHA1": "8XAGmXqf+b4LW91wsWxa4kH1NN0=",
		"path": "gopkg.in/h2non/bimg.v1",
		"revision": "9bb3ae10c5ce30e72f7ac0834368536fc095d6a7",
		"revisionTime": "2017-01-13T19:35:42Z"
	}
],
...

}

Now I want to use master version of bimg package, which is newer than version 1.0.7 fetched by govendor. What is a proper way to achieve this, beside manually downloading master version from github and saving it to the vendor folder?

ps: all dependencies are committed.

答案1

得分: 2

我在Go Slack上得到了@jbrandhorst的帮助:

> 你需要删除旧的依赖,govendor remove gopkg.in/h2non/bimg.v1
>
> [3:16] 源代码库似乎是github.com/h2non/bimg,所以使用govendor fetch github.com/h2non/bimg将其安装到你的vendor文件夹中
>
> [3:16] 如果你只想将其添加到你的vendor.json中,可以使用govendor add

英文:

I got help from @jbrandhorst in go slack:

> you'll want to remove the old one as well, govendor remove gopkg.in/h2non/bimg.v1
>
> [3:16] source repo appears to be github.com/h2non/bimg, so
> govendor fetch github.com/h2non/bimg will install it to your vendor
> folder
>
> [3:16] if you just want to add it to your vendor.json, you use
> govendor add I think

huangapple
  • 本文由 发表于 2017年2月14日 19:09:27
  • 转载请务必保留本文链接:https://go.coder-hub.com/42224603.html
匿名

发表评论

匿名网友

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

确定