英文:
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
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论