testKillTimeout = 10 * time.Minute
)
-var testMainDeps = map[string]bool{
+var testMainDeps = []string{
// Dependencies for testmain.
- "testing": true,
- "testing/internal/testdeps": true,
- "os": true,
+ "os",
+ "testing",
+ "testing/internal/testdeps",
}
func runTest(cmd *base.Command, args []string) {
cfg.BuildV = testV
deps := make(map[string]bool)
- for dep := range testMainDeps {
+ for _, dep := range testMainDeps {
deps[dep] = true
}
// The generated main also imports testing, regexp, and os.
stk.Push("testmain")
- for dep := range testMainDeps {
+ for _, dep := range testMainDeps {
if dep == ptest.ImportPath {
pmain.Internal.Imports = append(pmain.Internal.Imports, ptest)
} else {