Go to file
sudo pacman -Syu 2155c56e16
fix: ignore not go file and go generated error
2022-11-28 00:58:50 +07:00
.github chore: add github action, Makefile 2022-11-24 23:16:32 +07:00
cmd/gofimports feat: flags from gofmt 2022-11-24 23:11:15 +07:00
internal fix: ignore not go file and go generated error 2022-11-28 00:58:50 +07:00
.gitignore chore: init go.mod 2022-11-24 22:25:13 +07:00
.golangci.yml chore: add github action, Makefile 2022-11-24 23:16:32 +07:00
.goreleaser.yml chore: add github action, Makefile 2022-11-24 23:16:32 +07:00
LICENSE chore: add MIT license 2022-11-24 23:16:50 +07:00
Makefile feat: parse imports and group imports std 2022-11-26 02:10:19 +07:00
README.md chore: add install, usage in README 2022-11-28 00:36:32 +07:00
go.mod feat: print diff 2022-11-27 01:07:15 +07:00
go.sum feat: print diff 2022-11-27 01:07:15 +07:00

README.md

gofimports

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:

go install github.com/haunt98/gofimports/cmd/gofimports@latest

Usage

# 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

  • Diff with color
  • Add profiling
  • Improve performance

Thanks