Is there a one-shot way for govendor to "fix" your vendor.json?

blov · · 400 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<p>I&#39;m just curious, say I&#39;ve added some packages to my project, and removed some, and didn&#39;t run the specific update/remove commands as I did so.</p> <p>Is there a way to tell govendor to just &#34;fix everything&#34; 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&#39;s the preferred tool now, but dep is causing another issue. I have just one dependency and it&#39;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 &#39;version = &#34;^1.x.whatever&#34;&#39; to &#39;branch = &#34;master&#34;&#39; to always take master.</p> <p>Also &#34;dep init&#34; 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 &#34;dep ensure -update&#34; 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&#39;t be a jackass. This is not the question he asked, and dep has it&#39;s own issues. It&#39;s not a superior solution, it&#39;s just a different solution.</p></pre>dlsniper: <pre><p>It&#39;s a permanent solution, the one that&#39;s embraced by everyone else.</p></pre>Talindras: <pre><p>Except that everything you&#39;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&#39;m confused now. Am I a zealot or a jackass? It&#39;s hard to know what I should be, if I&#39;m honest.</p></pre>Talindras: <pre><p>I don&#39;t think there&#39;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&#39;s a bit more elegant than everything else I&#39;ve tried out. </p></pre>

入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889

400 次点击  
加入收藏 微博
0 回复
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传