4 ms·
As we are commenting here, the community is assembling by the minute... Go allows you to import "github.com/user/package" and will download and compile the code
by paufernandez 14y ago
As we are commenting here, the community is assembling by the minute... Go allows you to import "github.com/user/package" and will download and compile the code, so creating a new project is even easier than with node, no need to "npm install ..." first.
For a taste of what's out there, see: http://go.pkgdoc.org/index http://go.pkgdoc.org/index.
- jlarocco 14y agoThe GitHub thing was neat the first time I saw it, but then I thought about it some more, and I'm not sure it's such a good idea. I couldn't find any way to specify a specific tag or revision, so it's basically always getting the bleeding edge developer build of the library code. That might be nice in some situations, but for getting work done I almost always want the most recent stable release. Am I missing something?
- vito 14y agoI hit this a while ago. The first thing I tried to install failed, because it depended on something that depended on something that moved its repository location (renamed itself from foo.go to foo). It's a convenient hack but nothing more.
- paufernandez 14y agoIf I wanted a specific tag or release, I would just download that revision in the GOPATH directories, and refer to the package directly, instead of through the github URL.
- ConstantineXVI 14y agoKind of a clunky way to handle versioning though. In Lein (for example), adding [noir "1.2.0"] ensures I'm always grabbing the same version. In Go, appears the only way to guarantee this is to check in the full source of the library alongside your own in your repo.
- jamii 14y agoI wish Leiningen would also handle bleeding edge dependencies as easily as rebar eg: {deps, [ {quoted, "1.0.3", {git, "git://git.corp.smarkets.com/quoted.erl.git", {tag, "1.0.3"}}}, {proper, ".*", {git, "git://git.corp.smarkets.com/proper.git", {branch, "master"}}} ]}.
- ConstantineXVI 14y agoThis plugin[1] looks like what you're looking for. [1] https://github.com/tobyhede/lein-git-deps https://github.com/tobyhede/lein-git-deps
- jamii 14y ago"You will also need to manually add the checked-out project's dependencies as your own (the plugin simply checks out the code, it doesn't recursively resolve dependencies)." I've seen this plugin before but its not particularly useful without dependency checking. It's a start though. I'll have to look at leiningen to see if it exposes hooks for that sort of thing.
- deleted 14y ago[deleted]
- zemo 14y agoif the repository owners tags a commit with the tag Go1, it is used by Go. If there is no tag to specify which commit, the tip of master is used. In practice, most maintainers just keep master clean and do all development in a dev branch.
- KaoruAoiShiho 14y agonpm is awesome, this direct import doesn't seem like a feature, more like a lack of a feature.
- paufernandez 14y agoIt works very well for me. If I want someone to install a Go program I've developed, in Ubuntu 12.04 they can just: $ sudo apt-get install golang $ go get github.com/pauek/garzon/grz That's it, and it takes a few seconds.
- nilliams 14y agoThat's great to quickly show someone a program, but not so great if they try it a few weeks later and get a non-stable version of your program, otherwise that definitely won't be it, they'll have to spend some time figuring out what went wrong. If Go adds some method to specify a tagged version that could be pretty nice though. I hope it goes without saying that there's no way this kind of hack (neat as it is) is a substitute for a proper package management system like npm (which is a very good package manager).
- KaoruAoiShiho 14y agoHow's that any faster than npm install express Not only do npm handle versioning for you, you also don't have to remember the host or username. Obviously Go is a younger community, and could make a package manager some day, but I'm puzzled by how you're comparing this positively with npm.
- paufernandez 14y agoIt is faster because you don't have to install npm, the case I was explaining involves someone with no developing skills. And I'm not saying this feature of Go is better than npm, I also use npm and I like it very much. What I like is the fact that Go comes already with this feature and I don't need anything extra.
- 14y ago
- cageface 14y agoI also consider it a huge plus that Go produces a single, statically linked native binary. No fiddling around with directories of libraries and search paths required.