<p>I have read several ways to check dependencies. Shouldn't there be only one way to control the dependency flow with versioning? Is there a version control system which you suits you?</p>
<p>(go get doesn't count. It doesn't manage dependencies.)</p>
<hr/>**评论:**<br/><br/>ezlover111: <pre><p>+1 for gb</p></pre>dlsniper: <pre><p>I'm using godep (github.com/tools/godep) for a while now and it does the jov for me. Also a search either here or on the mailing list would help you find other threads just like this. </p></pre>genesem: <pre><p>simple way <a href="https://gopkg.in" rel="nofollow">https://gopkg.in</a></p></pre>dchapes: <pre><p>I'm always puzzled when someone mentions gopkg.in when dependency management is brought up.</p>
<p>All gopkg.does is provide a way that a package author can use to version their package import path. Further, it <em>only</em> works with GitHub repositories! It helps not-at-all for someone trying to manage their project's dependencies. I have no control of which my dependencies are on GitHub, Bitbucket, LauchPad, code.google.com, etc and which choose to use gopkg.in. Further, it helps not at all when I depend on package A which imports gopkg.in/foo.v1 and package B which imports gopkg.in/foo.v2; unless you assume silently having two compiled in slightly different versions of foo is somehow always (ever?) the right thing.</p></pre>genesem: <pre><p>yeah, but only as an option when there is no other options.</p></pre>elithrar_: <pre><p>There are lot of options, but from my experience <a href="https://github.com/tools/godep">godep</a> and <a href="http://getgb.io/">gb</a> are probably the two standouts.</p>
<p>Go itself will have some limited capability to build from vendored dependencies with the <code>-vendor</code> flag in (probably) 1.5 but there is no standardised manifest for tracking versions. This is partly because Go packages don't have their own concept of a version; only the VCS the package is in does.</p></pre>zeroXten: <pre><p>I've ended up writing one for pki.io to match our requirements. </p>
<p>We were using Gom but that was using upstream dependencies directly. We wanted full control of the supply chain, so we fork the dependencies into repos we own. I wrote fdm* to work in a similar way to Gom (GOPATH rewrite etc) but it works on the basis of forked dependencies. Basically, it clones from your fork and symlinks to a name matching the upstream. That way it avoids import rewriting, but at the moment it only works on *nix.</p>
<ul>
<li><a href="https://github.com/pki-io/fdm" rel="nofollow">https://github.com/pki-io/fdm</a></li>
</ul>
<p>Edit:</p>
<p>I'm actually in the middle of a major edit to work better with an automated supply-chain script I'm going to write. This will ensure the forks are kept update to date. It will allow releases to be consistent but will allow dev to build against the latest upstream.</p></pre>
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889
- 请尽量让自己的回复能够对别人有帮助
- 支持 Markdown 格式, **粗体**、~~删除线~~、
`单行代码`
- 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
- 图片支持拖拽、截图粘贴等方式上传