-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider adopting an idiomatic repository layout #1
Comments
Aha, thanks for the details. Yes, I'll do this. I had no idea about what I was doing :-P |
OK, this may be a stupid question... but how do I build my own code from HEAD if I do this?
|
Alternatives:
|
I can see how "end users" will be able to just fetch the code and build/install it with But that's not the problem I have. What I'm talking with "building from HEAD" is... I do:
If I try the |
Ah: you need to keep the project in your $GOPATH. You could use:
(Instead of manually creating the directory and cloning, you could also just use |
I think this is now resolved. |
Almost: you need a subdirectory within cmd/. Currently, your code is compiled into $GOPATH/bin/cmd. I think it should be cmd/sourcachefs/? |
This is to further address the recommendations expressed in issue #1.
Thanks for publishing this!
Currently, your import paths don’t resolve: you use e.g.
github.com/jmmv/sourcachefs/fs
in code, butgo get
will not be able to download that package, because it lives insrc/github.com/jmmv/sourcachefs/fs
instead offs
.This decision affects many downstream tools, such as godoc.org (for automatic API documentation) or packaging helpers (making it hard to package sourcachefs for Debian and others).
Please consider structuring your repository like so:
mv src/github.com/jmmv/sourcachefs/* .
internal
subdirectory. See https://docs.google.com/document/d/1e8kOo3r51b2BWtTs_1uADIA5djfXhPT36s6eHVRIvaU/editcmd
subdirectory, e.g.cmd/sourcachefs
.)For an example of this structure, see e.g. https://github.com/Debian/debiman/
The end result should be that users will be able to install/update your software using
go get -u github.com/jmmv/sourcachefs/cmd/sourcachefs
.Thanks for considering.
The text was updated successfully, but these errors were encountered: