Go Developer Tooling
My Go repos use several tools to make development easier. I develop on a Mac, so install instructions are MacOS-focused.
See example-go-cli for a repo using these tools.
Run various correctness checks on source code.
brew install golangci-lint
Note that with the
lintTool set to
Go VS Code extension will
go install golangci-lint, despite the fact that this is explicitly recommended against. ¯_(ツ)_/¯
Build platform-specific executables and auto-update Homebrew taps and Scoop buckets.
brew install goreleaser
goreleaser --snapshot --skip-publish --clean
Run Go tests with easier to read output, including color.
go install gotest.tools/gotestsum@latest
Install/Run/Uninstall pre-commit hooks that mimic CI.
brew install lefthook
Then run this from repo-root
- install pre-commit hook:
- uninstall pre-commit hook:
- Run pre-commit without committing:
lefthook run pre-commit
Make panic stack traces much easier to read with colorization and removing extraneous info
go install github.com/maruel/panicparse/v2/cmd/pp@latest
go run . |& pp
Script demo GIF creation!
brew install vhs
vhs < demo.tape