TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Dependencies and vendoring in Go

113 pointsby rgarciaabout 10 years ago

9 comments

wtbobabout 10 years ago
I think that the idea itself sounds grand. No doubt there&#x27;ll be some implementation hurdles, but it all makes sense.<p>But:<p>&gt; godep already uses JSON, as do Go tools themselves (e.g. “go list -json fmt”), so we’ll probably want something like godep’s JSON format…<p>Seriously, the only things good about JSON (and it <i>is</i> good) are that it&#x27;s so widely supported and that it has a clean representation of maps&#x2F;dicts&#x2F;hashes&#x2F;whatever-you-call-them. Take a look at the two lines of text config in the article, vice the twelve lines of JSON.<p>What&#x27;s wrong with nice, clean formats line text lines, s-expressions, even .ini? JSON is better than XML, but that&#x27;s damning with faint praise.
评论 #9142420 未加载
评论 #9141665 未加载
评论 #9143555 未加载
jffabout 10 years ago
This is more or less a tool-supported version of what we do at work--I&#x27;ve posted about it a few times, to sneering response.<p>The config file thing would hopefully be nice and small&#x2F;simple so it&#x27;s not a hassle to use. I think their &#x27;“rsc.io&#x2F;x86&#x2F;x86asm” with revision af2970a7819d&#x27; format would be more pleasant than JSON, but if they need more detail than just a repo path and a revision, JSON may be the way to go.
leefabout 10 years ago
Don&#x27;t get too excited. This proposal is more a codification of the &quot;easy&quot; part of managing dependencies for top level&#x2F;binary packages that much of the community already does. This proposal does not (and isn&#x27;t intended) to cover how dependencies work when vending libraries and does not address shared package and diamond shaped dependencies.<p>That&#x27;s not to say having a standard for vendoring isn&#x27;t a good thing.
nitwit005about 10 years ago
Things seem extremely nice in go when you start out in go and see &quot;go get&quot;, but then you&#x27;ll quickly ram into not wanting the latest master, and then get extremely puzzled about how to do library dependencies.<p>I wish I saw some sort of consensus on library dependencies in that thread. Too much of our work build relies on setup scripts.
gonoobieabout 10 years ago
I thought this was a decent proposal:<p><a href="https://github.com/mattes/go/blob/fix-dependencies/fix-dependencies.md" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;mattes&#x2F;go&#x2F;blob&#x2F;fix-dependencies&#x2F;fix-depen...</a><p>Discussed here:<p><a href="https://www.reddit.com/r/golang/comments/2xeuu0/allow_revisions_in_import_path_like_go_get/" rel="nofollow">https:&#x2F;&#x2F;www.reddit.com&#x2F;r&#x2F;golang&#x2F;comments&#x2F;2xeuu0&#x2F;allow_revisi...</a>
评论 #9141666 未加载
JulianMorrisonabout 10 years ago
Seems to me, it was perhaps the worst decision Go made, not to build version numbers into the import syntax and file path layout from day one.
ChikkaChiChiabout 10 years ago
The issue of disappearing vendors can largely be solved using godep and distributing binaries, but I don&#x27;t feel like any language I&#x27;ve used has an effective mechanism for coupling unit testing with dependency management.<p>Wouldn&#x27;t it make sense to be able to test your code in advance of updating a dependency to see the how&#x27;s and why&#x27;s of its failures?
评论 #9141131 未加载
评论 #9140845 未加载
aosmithabout 10 years ago
I&#x27;ve been doing this with a simple alias and a src directory for quite some time:<p>alias go=&#x27;GOPATH=`pwd`:$GOPATH go&#x27;
tomohawkabout 10 years ago
glide works really well for this: <a href="http://technosophos.com/2014/09/22/how-glide-solves-go-vendoring.html" rel="nofollow">http:&#x2F;&#x2F;technosophos.com&#x2F;2014&#x2F;09&#x2F;22&#x2F;how-glide-solves-go-vendo...</a>