Skip to content
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

Rearrange the project structure #12

Merged
merged 1 commit into from
Feb 14, 2019
Merged

Conversation

RobAtticus
Copy link
Member

We are making a push to make our projects eventually all conform
with Golang best practices and this project setup seems to be widely
agreed upon in the community.

For now I have moved all packages into internal/; however, we may
find that some of them are useful to expose to other projects, at
which point we should move them to pkg/. All the files related to
the 'outflux' binary itself are now located in cmd/outflux.

A small bug fix is also included in schema_transfer.go, where the
wrong error message was being printed.

@RobAtticus
Copy link
Member Author

I am interested in hearing others thoughts on this directory structure. I used it for timescaledb-tune and moved timescaledb-parallel-copy to it. I know we have a couple of CLI applications we are maintaining now, so it would be nice as an org to come to consensus.

This seems to be a "community standard" but I think Cobra does things slightly differently. So happy to hear other thoughts.

@LeeHampton
Copy link

I like this approach. I was using pkg but making it internal unless exposed makes more sense. Cobra does have a weird recommended way of doing things where each subcommand is a package or something, but there are several issues complaining about it: spf13/cobra#641 ... I think it's fine to just have all of the CLI/cobra stuff as part of the main package.

We are making a push to make our projects eventually all conform
with Golang best practices and this project setup seems to be widely
agreed upon in the community.

For now I have moved all packages into internal/; however, we may
find that some of them are useful to expose to other projects, at
which point we should move them to pkg/. All the files related to
the 'outflux' binary itself are now located in cmd/outflux.

A small bug fix is also included in schema_transfer.go, where the
wrong error message was being printed.
@atanasovskib atanasovskib merged commit 0f5a7f1 into master Feb 14, 2019
@atanasovskib atanasovskib deleted the rrk/refactor-layout branch February 14, 2019 07:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants