4 ms·
Go doesn’t “do” that. Using GitHub HEAD is one of many ways it can be used. It’s not a very popular approach. People with important projects that often use oth
by shurcooL 9y ago
Go doesn’t “do” that.
Using GitHub HEAD is one of many ways it can be used. It’s not a very popular approach. People with important projects that often use other ways, such as vendoring via a tool like dep.
- deleted 9y ago[deleted]
- calcifer 9y ago> Go doesn't "do" that Literally the first example of the Go tour [1] tells you to run "go get". "dep" is not (yet) an official part of Go's tooling. So when the only official tool fetches HEAD and calls it a day, I think it's perfectly fine to say "Go does that". [1] https://golang.org/doc/ https://golang.org/doc/
- petre 9y agoIt's pretty annoying. Most of the time I want to build a stable version not HEAD which could break in many ways. Using HEAD as a dep is pretty much insane. Stop publishing for several months and the code would most likely fail to build.
- slrz 9y agoThe 'go get' tool is just a small convenience wrapper around git/hg/svn. Its intended for use by developers, for quickly taking a look at some source code. The tour use case you cited is also a good fit for 'go get'. It was never intended to be a part of your production build process. If you push its outputs directly to production, you're holding it wrong.
- cstejerean 9y agoGo doesn't do that, but it enables it and I'd even say encourages it, starting from the documentation https://golang.org/doc/code.html#Library https://golang.org/doc/code.html#Library Even projects using dep continue this pattern of pulling things from github master. I just browed through the top projects on Github for go and pretty much all of them that contained a gopkg.toml pulled in one or more things from github directly from master https://github.com/grafana/grafana/blob/master/Gopkg.toml https://github.com/grafana/grafana/blob/master/Gopkg.toml https://github.com/containous/traefik/blob/master/Gopkg.toml https://github.com/containous/traefik/blob/master/Gopkg.toml https://github.com/cockroachdb/cockroach/blob/master/Gopkg.toml https://github.com/cockroachdb/cockroach/blob/master/Gopkg.t... https://github.com/github/hub/blob/master/Gopkg.toml https://github.com/github/hub/blob/master/Gopkg.toml These include projects like graphana, cockroachdb and hugo.
- drakenot 9y agoIt is an extremely popular approach. It might not be the best way, but I’d argue it is the default for most people.