run tests for all go modules in subfolders

Viewed 648

I've created the following directory tree with utilities to work with git.

./git-logbranch/git-logbranch_test.go
./git-logbranch/git-logbranch.go
./git-logbranch/go.mod
./git-issue/git-issue_test.go
./git-issue/go.mod
./git-issue/git-issue.go
./main.go
./go.mod

I've read several posts that say './...' will automatically run tests in all sub-folders, but it in fact does not do so. This is what I'm running and the output I get:

$ go test ./...
?       main    [no test files]

Here's some example output from the subfolders. As you can see, the individual tests work:

$ go test ./...
ok      git_logbranch   0.001s

$ go test ./...
ok      git_issue   (cached)

Any ideas on how to run all these tests at once?

1 Answers
Related