Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> Why are you not able to easily version git dependencies? Go's solution to this problem is to tell you to create an entirely new git repository for each major version. Really? If they didn't want to go full blown dependency versioning with something like CocoaPods, they could at least let you specify a git branch or tag.

Take a look at gopkg.in[1]. This is a service that makes branches in other repositories go-gettable. Eg. go getting gopkg.in/foo/bar/v5 will download branch v5 from github.com/foo/bar. This seems to me to be a way of dealing reasonaly well with the issue -- the go get tool itself doesn't need to understand anything at all here.

[1] http://labix.org/gopkg.in



A nasty workaround for a problem which should not exist in the first place. Ditto dependencies on private repositories.


> A nasty workaround for a problem which should not exist in the first place.

In Go I believe they use the term "idiomatic." ;-)


I personally don't see having the version in the package address particularly more nasty than specifying it in the project file, as in Maven, which I have been dealing with lately. One problem I imagine is that when migrating to a new version of a library, the address has to be updated in each file the library is used in, with potentially catastrophic consequences if any one file is forgotten. A grep seems wise in that case.

Would you argue that there are more robust solutions in the Haskell ecosystem? What scheme do you prefer?


I don't think the issue was with specifying the version in the package address. It is that you need to use a 3rd party, remote service, to redirect your requests to the appropriate git repo and branch.

This is because Go doesn't support specifying branches/tags itself when specifying a git dependency.

This workaround is contingent on gopkg.in people keeping their service maintained and running. If they went down, all your dependencies would break.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: