3 ms·
I put "package manager" in scare quotation marks because one of the design goals of Go is essentially to render most of the functionality of such package manage
by grey-area 13y ago
I put "package manager" in scare quotation marks because one of the design goals of Go is essentially to render most of the functionality of such package managers irrelevant.
Golang does have a de-facto package manager in go get (with its own conventions on file system layout etc), it just doesn't handle versioning. The Go packaging system is pretty good, but it isn't perfect, and I'm not convinced vendoring is a viable solution if you're going to be sharing code and collaborating on several open source projects - it's a recipe for lots of incompatible versions with security and other bugs unfixed floating around in different projects, and a lot of confusion from newcomers about the required version of a library because it is not specified anywhere.
The current approach works perfectly if you are working in-house, willing to do your own dependency resolution, and are happy to vendor your own dependencies - it's completely reasonable within one company or org to do this. However it fails in more collaborative or open-source environments like libraries shared on github depending on other libraries shared on github. I do think they need version pinning for that (in fact they have version pinning for the language in go get, just not for individual packages), it wouldn't be a large change.
For example, in the recent Stripe CTF, people ended up downloading and building different packages locally than those available on the server builds, because there was no clarity on which version was included. That was kind of annoying. It could be solved by vendoring, but then you have other issues in the long-term with relying on other people to keep their pkg dependencies up to date or you can be including two conflicting versions of a third pkg.
They've taken an interesting approach in trying to eschew versions (which avoids some problems with dependency resolution), but I'm not sure it is sustainable long-term. Didn't they also try to make golang itself version free initially?
- numbsafari 13y agoCheck out this posting by James Graves regarding using your SCM to manage the versions[1]. There are two main downsides with this approach: (1) you have to import projects not managed in git and make a few changes (could be automated very easily) and (2) you have to deal with git submodules. (1) can be dealt with fairly easily with a little bit of perl or python (or... go). (2) is largely the approach he chose to take. You could also import those submodules directly into your tree and do subtree merges [2]. The "go doesn't have package management" meme is propagated by people unwilling to think outside the box of "what new tool and infrastructure can I force myself to depend on". At least in the world of go you are re-using existing code distribution systems and infrastructure that are, by their very nature, already versioned and distributed (git, mercurial) and a simple set of tools (go get) and you have some kind of compile-time checking about your dependencies. [1] http://goo.gl/vcbOmO http://goo.gl/vcbOmO [2] http://git-scm.com/book/ch6-7.html http://git-scm.com/book/ch6-7.html