This is a collection of golang pre-commit hooks specifcally for build, generate, unit tests, and other build-time workflow checks.
If you need a pre-commit for a linter or formatter, check out the official golangci-lint pre-commit: https://github.com/golangci/golangci-lint/blob/main/.pre-commit-hooks.yaml
- repo: https://github.com/bhundven/golang-pre-commit.git
rev: v1
hooks:
- id: go-generatego-unit-tests- Runsgo test. Requires golang: https://go.dev/doc/installgo-build- Runsgo build. Requires golang: https://go.dev/doc/installgo-generate- Runsgo generate. Requires golang: https://go.dev/doc/installgo-mod-tidy- Runsgo mod tidy -v. Requires golang: https://go.dev/doc/installgo-mod-vendor- Runsgo mod vendor. Requires golang: https://go.dev/doc/install