#6294·memos

Go: run `goimports -w .` and `go fix ./...` for consistent formatting

Author: coolaj86Created Sep 7, 2026Updated Sep 28, 2026

Check before submitting

  • I searched existing issues and did not find a duplicate

What problem would this solve?

Many people who program in Go use the de facto "recommended" plugins (meaning the ones you get pretty much by default with any Go-supported editor if you just click "Yes" the first time you get the pop up on a .go file). Trying to edit these files with those tools makes a lot of changes that are unrelated to the PR at hand.

What would you like to happen?

  • Do a one time run of goimports -w . && go fix ./... on the codebase and commit it
  • Make goimports -w . && go fix ./... part of the CI/CD pipeline so that the codebase stays "Go style"

Additional context

  • goimports -w . will run go fmt and also sort imports by stdlib block and double-newline-separated blocks, and then lexicographically within each block
  • go fix ./... will modernize the codebase to match the idioms of the version of go in go.mod