pre-commit
pre-commit copied to clipboard
Change the way `go fmt` is executed
Since $@ contains a filtered list of all *.go files that are staged for the commit, calling go fmt on them individually stops the error being thrown when trying to run go fmt against a subdirectory, from a directory which does not contain a go.mod file
Description
This is one potential workaround for the issue described by me in issue #67
Documentation
TODOs
Please ensure all of these TODOs are completed before asking for a review.
- [x] Ensure the branch is named correctly with the issue number. e.g:
feature/new-vpc-endpoints-955orbug/missing-count-param-434. - [n/a] Update the docs.
- [x] Keep the changes backward compatible where possible.
- [x] Run the pre-commit checks successfully.
- [n/a] Run the relevant tests successfully.
Related Issues
Fixes #67