chore: add install, usage in README

main
sudo pacman -Syu 2022-11-28 00:36:32 +07:00
parent 5a62dae185
commit 1c6c554a49
No known key found for this signature in database
GPG Key ID: D6CB5C6C567C47B0
1 changed files with 28 additions and 2 deletions

View File

@ -1,12 +1,38 @@
# gofimports # gofimports
goimports with my opinionated preferences. Group Go imports with my opinionated preferences.
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.
So please run `gofumpt` or `gofmt` after this.
## Install
With Go version `>= 1.16`:
```sh
go install github.com/haunt98/gofimports/cmd/gofimports@latest
```
## Usage
```sh
# Format ./internal
# with print impacted file (-l),
# write to file (-w),
# print diff (-d)
# company is github.com/make-go-great
gofimports -l -company github.com/make-go-great -w -d ./internal
```
## Roadmap ## Roadmap
- [ ] Diff with color - [ ] Diff with color
- [ ] Add profiling - [ ] Add profiling
- [ ] Use profiling to improve performance - [ ] Improve performance
## Thanks ## Thanks