Skip to content
This repository was archived by the owner on Mar 12, 2025. It is now read-only.

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

No branches or pull requests

1 participant