<p>One of the problems I've run into recently is poor dependency management for my Go projects, with dependencies causing breakages after accidentally wiping away a GOPATH and downloading the latest versions. </p>
<p>This was my fault, but I was just wondering, has the community come to a good solution for fixing this issue? I know there are a few systems like godep out there that offer a more managed approach, but is this widely accepted as the standard approach?</p>
<hr/>**评论:**<br/><br/>zond: <pre><p>I have had an excellent experience using <a href="http://godoc.org/github.com/mjibson/party">http://godoc.org/github.com/mjibson/party</a></p>
<p>It automates the "copy deps to a subdirectory and change all import paths" task, nothing else.</p>
<p>No config file, no tags, no comments necessary. </p>
<p>Manage your deps manually by updating them in your GOPATH using 'git' and 'go get', then update everything in your vendor dir with a single 'party' invocation.</p></pre>djhworld: <pre><p>Very interesting, will check it out - thanks!</p></pre>kron4eg: <pre><p>yes, vendor as much as you can</p></pre>noydoc: <pre><p>I'm not sure we will ever. It's not a problem Google has.</p>
<p>My biggest criticism of golang is how painful it can be when Google's use-case is different than mine, or yours.</p></pre>: <pre><p>[deleted]</p></pre>noydoc: <pre><p>The community has created several independent solutions without consensus.</p>
<p>Google has the ability to embed dependency management into the go binary beyond <code>go get</code>. This would force consensus onto the community.</p></pre>anacrolix: <pre><p>Fork Go and pull their lame GC and bug fixes.</p></pre>jimuazu: <pre><p>There is a recommended approach here from the Go team:
<a href="https://groups.google.com/forum/m/#!topic/golang-dev/nMWoEAG55v8">https://groups.google.com/forum/m/#!topic/golang-dev/nMWoEAG55v8</a></p></pre>esdffffffffff: <pre><p>Yup, this is the answer. For me, i'm changing nothing, and waiting till 1.5. Then converting everything to that.</p></pre>om0tho: <pre><p>Same.</p></pre>gogolang: <pre><p>I tend to fork a lot and use forked versions</p></pre>robertmeta: <pre><p>If you are writing an application -> vendor using tool of your choice (godeps, etc)</p>
<p>If you are writing a library -> gopkg.in</p></pre>silent__thought: <pre><p>I wish the Go project would adopt gopkg.in like they did godoc.org. Excellent project and core to the ecosystem IMO.</p></pre>avrtno: <pre><p>Godoc.org works without the cooperation of the package author.</p>
<p>Gopkg.in requires the cooperation of the package author. </p>
<p>Many people think that gopkg.in solves problems that it does not actually solve. </p></pre>silent__thought: <pre><p>Honestly the only feature I care about is that I'm able to maintain multiple API versions in the same repo. As a package writer that frustrates the heck out of me with "go get".</p></pre>zond: <pre><p>You can do that anyway. Compare <code>github.com/zond/someproject/v1/somepackage</code> and <code>github.com/zond/someproject/v2/somepackage</code>. </p></pre>silent__thought: <pre><p>I'm a bit embarrassed to admit that hadn't occurred to me. Thanks!</p></pre>robertmeta: <pre><blockquote>
<p>Gopkg.in requires the cooperation of the package author. </p>
</blockquote>
<p>For beyond v0, absolutely. I don't consider this a flaw. </p>
<blockquote>
<p>Many people think that gopkg.in solves problems that it does not actually solve. </p>
</blockquote>
<p>What is the misunderstanding people have about it?</p></pre>robertmeta: <pre><p>I like gopkg.in -- but am not to the point I would like it blessed yet. </p></pre>
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889
- 请尽量让自己的回复能够对别人有帮助
- 支持 Markdown 格式, **粗体**、~~删除线~~、
`单行代码`
- 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
- 图片支持拖拽、截图粘贴等方式上传