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

Add import grouping to the styleguide #17

Open
ekcasey opened this issue Feb 26, 2021 · 0 comments
Open

Add import grouping to the styleguide #17

ekcasey opened this issue Feb 26, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@ekcasey
Copy link
Member

ekcasey commented Feb 26, 2021

We should describe how import statements should be grouped in the styleguide. This seems like a great example of the kind of detail that can cause unnecessary back-and-forth on a PR. I would suggest we organize imports in one delaration with three groups:

  1. stdlib
  2. external (imported from another repo or module)
  3. internal (same module)

This can be configured in Goland with the following settings:
Screen Shot 2021-02-26 at 4 43 38 PM

Or automated with the following command:

goimports -l -w -local <module> .

e.g

goimports -l -w -local github.com/paketo-buildpacks/environment-variables .
@ekcasey ekcasey added the enhancement New feature or request label Feb 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant