Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change the way go fmt is executed #68

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gchappel
Copy link

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.

  • 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.
  • Keep the changes backward compatible where possible.
  • Run the pre-commit checks successfully.
  • [n/a] Run the relevant tests successfully.

Related Issues

Fixes #67

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

gofmt check fails if go.mod and go.sum are not in the root directory
1 participant