Skip to content

Commit

Permalink
Mention how to get imports right in IDEA or Goland. (#1242)
Browse files Browse the repository at this point in the history
Signed-off-by: Marcin Owsiany <marcin@owsiany.pl>
Co-Authored-By: Aleksey Dukhovniy <adukhovniy@mesosphere.io>
  • Loading branch information
porridge and Aleksey Dukhovniy committed Jan 9, 2020
1 parent 6dcbee3 commit 08f299e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions STYLEGUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,15 @@ Executing `make lint` uses `goimports` which is configured to ensure this struct

`make imports` is also a useful tool in order to help create this structure. If all imports are in 1 import block (no lines of separation), `make imports` will modify the file in the appropriate order and structure.

If you use Goland or Intellij IDEA, setting the following under "Editor > Code Style > Go" in the "Imports" tab will match the above requirements:
```
[x] Add parentheses for a single import
Sorting type [gofmt]
[x] Group stdlib imports
[x] Move all stdlib imports in a single group
[x] Group current project imports
[x] Move all import in a single declaration
```

### Naming

Expand Down

0 comments on commit 08f299e

Please sign in to comment.