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?
https://github.com/golang/go/wiki/Modules#how-to-define-a-module
When executed from the root directory of a module, the
./...
pattern matches all the packages within the current module.
(note: it does not say "within the current directory")
https://golang.org/cmd/go/#hdr-Defining_a_module
The module is the set of all Go packages in the module root and its subdirectories, but excluding subtrees with their own go.mod files.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With