You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to use the new go-generate hook and ran into an error:
go-generate..............................................................Failed
- hook id: go-generate
- exit code: 1
named files must all be in one directory; have path/to/a/package and path/to/another/package
As per the generate documentation it appears go generate can handle multiple files in the same package and multiple packages, however it can't handle multiple files in the same package.
The text was updated successfully, but these errors were encountered:
I came here to report the same problem. I don't think it makes sense for go-generate to operate on the list of modified files; typically, things generated with go generate are required to build, so if you're running these tests in CI you need to run go generate on all files.
The run-go-generate.sh script should probably do nothing more than...
Hmm, right, I forget that "accepts files" does not mean the files can be in separate packages. This sounds similar to #47, #62, #63, but for go generate instead of go vet.
I don't think it makes sense for go-generate to operate on the list of modified files; typically, things generated with go generate are required to build, so if you're running these tests in CI you need to run go generate on all files.
I don't think it's fair to assume that everyone wants to run go generate on all files. The command run by go generate could be slow, so running on only the files that have changed seems like the right default behaviour. That feels to me like the intent of the pre-commit framework, which is why it passes the list of changed files to the hooks.
I think we need to do something similar to what we have for go vet: go list to get all the packages, then iterate over any changed packages.
Hi folks,
I tried to use the new
go-generate
hook and ran into an error:As per the generate documentation it appears
go generate
can handle multiple files in the same package and multiple packages, however it can't handle multiple files in the same package.The text was updated successfully, but these errors were encountered: