Take a look at this directory structure:
/root
/hoge
go.mod
go.sum
main.go
/test
main_test.go
/unit
sub_test.go
/fuga
go.mod
go.sum
main.go
/test
main_test.go
You can run the test with the following code, but if it fails, it will always return an exit code of 0.
find . -name go.mod -execdir go test ./... \;
Is there any way to return non-zero if it fails?