【发布时间】:2020-04-11 20:30:37
【问题描述】:
看看这个目录结构:
/root
/one
go.mod
go.sum
main.go
main_test.go
/two
go.mod
go.sum
main.go
main_test.go
假设我在父目录root/ 中,我想运行所有子目录中的所有测试。我该怎么办?我试过go test./... 并得到以下错误:
go: warning: "./..." matched no packages
no packages to test
【问题讨论】:
-
find . -name go.mod -execdir go test ./... \; -
@BaytaDarell,您应该将此作为回复发布,您将获得一些当之无愧的支持。
标签: unit-testing go testing