Skip to content

Commit 9e8e95d

Browse files
committed
Update main.go
1 parent f8d9eb4 commit 9e8e95d

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

main.go

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,28 @@
11
package main
22

3-
func main() {}
3+
import (
4+
"io/fs"
5+
"os"
6+
"os/exec"
7+
"path"
8+
)
9+
10+
func main() {
11+
12+
var matches, err = (fs.Glob(os.DirFS("./"), "./*/go.mod"))
13+
if err != nil {
14+
return
15+
}
16+
17+
for _, m := range matches {
18+
cmd := exec.Command("go", "test", "-v")
19+
// fmt.Println(path.Dir(m), (cmd.Dir))
20+
cmd.Dir = "./" + path.Dir(m)
21+
cmd.Stdout = os.Stdout
22+
cmd.Stderr = os.Stderr
23+
var err = cmd.Run()
24+
if err != nil {
25+
panic(err)
26+
}
27+
}
28+
}

0 commit comments

Comments
 (0)