pre-commit icon indicating copy to clipboard operation
pre-commit copied to clipboard

Change the way `go fmt` is executed

Open gchappel opened this issue 4 years ago • 0 comments

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-955 or bug/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

gchappel avatar Jan 20 '22 14:01 gchappel