6 ms·
Please somebody explain me how to manage next situation without manual copying of code and forking repos (in other words, we need to still be able get updates f
by EugeneOZ 12y ago
Please somebody explain me how to manage next situation without manual copying of code and forking repos (in other words, we need to still be able get updates for minor versions from repositories).
GOROOT/
pkg
src/
lib1
app1
app2
And app1 requires lib1 version 3.x, app2 requires lib1 version 1.x.
What can we do?
Also, on whole this page https://golang.org/cmd/go/ https://golang.org/cmd/go/ I can't find ANY info, about how to fetch exact version from repo, not the master branch. In Go world all master branches are for stable code only, not for development? And all tools have only one version?
- NateDad 12y agoThere's no such thing as lib1 version 3.x. lib1 is a single version. Every import path is a unique package. If you want to make a new version of lib1, you need to give it a different path. This can be as easy as manually inserting "v2" in the path, like /lib1/v2/ or /v2/lib1/ There's no way to use "go get" to get anything other than the head of the master branch... at least, not by default. If you use a service like http://gopkg.in http://gopkg.in then you can encode a version in the url/import path which can then redirect to a branch in github, so for example import "gopkg.in/natefinch/lumberjack.v2" will get the v2 branch of github.com/natefinch/lumberjack (gopkg.in does this with some git magic)
- EugeneOZ 12y ago> There's no such thing as lib1 version 3.x. lib1 is a single version. I don't agree with this part (or we are talking about different things), but thanks for the second part of reply. At least something :)