<p>I'm just curious, say I've added some packages to my project, and removed some, and didn't run the specific update/remove commands as I did so.</p>
<p>Is there a way to tell govendor to just "fix everything" so my vendor.json is corrected?</p>
<hr/>**评论:**<br/><br/>dlsniper: <pre><p>Yes, use <a href="https://github.com/golang/dep" rel="nofollow">https://github.com/golang/dep</a></p></pre>aminoglycine: <pre><p>actually, I just switched to dep seeing that it's the preferred tool now, but dep is causing another issue. I have just one dependency and it's pulling down what seems to be an older version of it. Why is it doing that?</p></pre>gxti: <pre><p>If the project has tags then dep will pick the latest tag by default. You can edit Gopkg.toml and change 'version = "^1.x.whatever"' to 'branch = "master"' to always take master.</p>
<p>Also "dep init" will write out an initial Gopkg.toml that will lock to you to the same major version. If you always want the latest tag version, you can just use a blank Gopkg.toml and then "dep ensure -update" will always move you to the latest tags. Or you can change all the version constraints to branch ones to take the tip of that branch.</p></pre>aminoglycine: <pre><p>Thanks!</p></pre>Talindras: <pre><p>Don't be a jackass. This is not the question he asked, and dep has it's own issues. It's not a superior solution, it's just a different solution.</p></pre>dlsniper: <pre><p>It's a permanent solution, the one that's embraced by everyone else.</p></pre>Talindras: <pre><p>Except that everything you've just said is wrong.</p></pre>dlsniper: <pre><p>Ok :)</p></pre>Talindras: <pre><p>Nothing like a zealot who believes in The One True Way(tm).</p></pre>dlsniper: <pre><p>I'm confused now. Am I a zealot or a jackass? It's hard to know what I should be, if I'm honest.</p></pre>Talindras: <pre><p>I don't think there's an all-in-one shot like you want short of deleting vendor and re-initializing it.</p>
<p><code>rm -rf vendor</code>
<code>govendor fetch +e</code></p></pre>igknighted: <pre><p>I just use glide for vendoring. I personally like it and last time I checked, it's a bit more elegant than everything else I've tried out. </p></pre>
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889
- 请尽量让自己的回复能够对别人有帮助
- 支持 Markdown 格式, **粗体**、~~删除线~~、
`单行代码`
- 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
- 图片支持拖拽、截图粘贴等方式上传