chore: fix typo

main
sudo pacman -Syu 2022-11-28 11:36:53 +07:00
parent 965880e09b
commit 7e1dc2df7d
No known key found for this signature in database
GPG Key ID: D6CB5C6C567C47B0
2 changed files with 8 additions and 6 deletions

View File

@ -5,19 +5,19 @@
Group Go imports with my opinionated preferences.
First is standard.
Then third party, then company if exist.
The last is local.
First is **standard**.
Then **third party**, then **company** if exist.
The last is **local**.
Also main selling point of this is group imports not sort imports.
Also main selling point of this tool is to group imports not sort them.
So please run `gofumpt` or `gofmt` after running this tool.
Under the hood, this tool get all imports, then group them into 4 groups (std, third party, company, local).
Remember, no sort here.
Remember, **no** sort here.
Then insert empty import (empty path) between each group to get final imports
Then update Go ast decls import with final imports.
There is side effect of course, because we do not create empty line but we add empty import, so there is trailing space in that line (Go indent that empty impoty).
There is side effect of course, because we do not create empty line but we add empty import, so there is trailing space in that line (Go indent that empty import).
That why I suggest you need to re-format after.
## Install

View File

@ -36,7 +36,9 @@ var (
)
// stdPackages -> save std packages for later search
//
// moduleNames -> map path to its go.mod module name
//
// formattedPaths -> make sure we not format path more than 1 time
type Formatter struct {
stdPackages map[string]struct{}