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

Test-only directory causes error "no non-test Go files in..." #78

Open
sgielen opened this issue Nov 15, 2021 · 0 comments
Open

Test-only directory causes error "no non-test Go files in..." #78

sgielen opened this issue Nov 15, 2021 · 0 comments

Comments

@sgielen
Copy link

sgielen commented Nov 15, 2021

I have a directory containing only go testing files, for integration tests. I.e.:

src/
  foo/
    impl.go        # for implementation
    impl_test.go   # for unit tests
    test/
      impl_test.go # for integration tests

When I run go build ./... in the root, this succeeds without warning (this is supported since this go commit). However, the default go-build precommit doesn't like it:

go-build.................................................................Failed
- hook id: go-build
- exit code: 1

go build mytest/foo/test: no non-test Go files in /.../repo/src/foo/test
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

No branches or pull requests

1 participant