-
Notifications
You must be signed in to change notification settings - Fork 148
Q: symlink to avoid $PROJECT/src/github.com/my/project hierarchy? #116
Comments
Symlinks are not supported because they allow one piece of code to have As gb doesn't require URLs in the import path you can avoid this name On Sat, 23 May 2015 07:41 Thorsten von Eicken notifications@github.com
|
Ok, how does this translate to libraries using gb? If I have a library with 2 packages one of which imports the other, how can this work? E.g. pkgB imports pkgA but then the library gets vendored into some other project as $PROJECT/vendor/src/github.com/my/library and the import paths all need to be rewritten? Is that the intent? |
I'm not sure if I understand your question, but if you have a project with two packages
|
To pick-up your example, if I want to avoid the /github.com/you part and I have a library with:
Then Another issue that concerns me is that even with the full layout:
Doesn't this library become impossible to Maybe a good question is the following: is it a must-have to you to make gb usable for libraries, and if so is it also a must-have to make these libraries usable outside of gb without having to jump through major hoops? (If the answer isn't yes & yes then that makes gb much less attractive to me, but I don't claim to be anywhere close to "representative" :-). |
When
So they retain their canonical import path. I am sorry, this is yet not very well explained on the getgb site. #49
Yes, gb projects are not go gettable. This is a result of adopting a different layout for projects that is not compatbile with go get.
Yes, gb supports writing libraries, groups of packages that don't produce a binary directly, see #49. |
I see, thanks for the clarification. That's a pretty drastic butchering of the repo the library comes from, but it's clearly necessary. Mhhh, not sure what to think about that... Regardless, thanks for taking the initiative to attack the beast! |
Answered; closing for the moment. |
My projects tend to have sub-packages that import each other. E.g. in
github.com/my/project/pkgA
I haveimport "github.com/my/project/pkgB
. As far as I can tell, this means that all my source code has to be placed into$PROJECT/src/github.com/my/project/pkg*
instead of just into$PROJECT/src/pkg*
, or am I missing something?To avoid the deep nesting I created a symlink:
$PROJECT/src/github/my/project
->../..
and it seems to work fine. Is it safe or am I going to run into issues down the road? Is this an officially supported method or an officially banned method?The text was updated successfully, but these errors were encountered: