Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Proposal: Create packages directory #14143

Closed
tac0turtle opened this issue Dec 3, 2022 · 11 comments
Closed

Proposal: Create packages directory #14143

tac0turtle opened this issue Dec 3, 2022 · 11 comments

Comments

@tac0turtle
Copy link
Member

In light of many things being spun out into their own go.mod or package, I'd like to propose packages like errors math collections are put into a packages directory to not increase the size of the root directory.

@itsdevbear
Copy link

🙏 +1

@julienrbrt
Copy link
Member

julienrbrt commented Dec 4, 2022

How are we defining the split?
Personally I prefer how we have it now.

Here's some thoughts: golang-standards/project-layout#10

@aaronc
Copy link
Member

aaronc commented Dec 4, 2022

The downside is increasing import length and maybe breaking some code. Don't have a strong opinion though

@tac0turtle
Copy link
Member Author

Wont import length stay the same with vanity urls?

@aaronc
Copy link
Member

aaronc commented Dec 5, 2022

Maybe you're right, not 100% sure. We should do a test case.

@tac0turtle
Copy link
Member Author

How are we defining the split? Personally I prefer how we have it now.

Here's some thoughts: golang-standards/project-layout#10

reading the issue, it looks like the conclusion is do what you think is best for your project. There are equally enough pros and cons for both.

The reason I was thinking about this is I'm not a fan of massive root directories and with vanity urls they can be imported under what evert we would like

@itsdevbear
Copy link

itsdevbear commented Dec 5, 2022

A golang "standard" was never really created.

I personally adhere to the pkg and internal heuristic fairly closely, gives our repos a sense of orderliness and hierarchy.

A massive root directory (in my opinion) prevents the repo from having a "flow". Sounds cheesy, but the repo file structure should read like a logically ordered book.

@tac0turtle
Copy link
Member Author

before making the final call we should make sure Cosmossdk.io/math would still work with a directory path of cosmos-sdk/pkg/math

@tac0turtle
Copy link
Member Author

looking into this, urls would need to change, so its not worth making this breaking change for users

@itsdevbear
Copy link

no stress, not that serious

@robert-zaremba
Copy link
Collaborator

for the record, I think the current layout is better. It's a Go project, so there is no need for root directories like src or packages. Moreover every directory, in go standard, is a package.

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

5 participants