gruntwork-io / pre-commit

A collection of pre-commit hooks used by Gruntwork tools
https://gruntwork.io/
Apache License 2.0
484 stars 155 forks source link

Change the way `go fmt` is executed #68

Open gchappel opened 2 years ago

gchappel commented 2 years ago

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.

Related Issues

Fixes #67