Commit e2c30e1f authored by Russ Cox's avatar Russ Cox

cmd/go: change testMainDeps from map to slice

This makes the construction of pmain.Internal.Imports consistently ordered.

Change-Id: I82348a18c7824378aa7e5bc5b6bcd550d4b758da
Reviewed-on: https://go-review.googlesource.com/56271
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
parent 75cb22cb
......@@ -425,11 +425,11 @@ var (
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) {
......@@ -490,7 +490,7 @@ 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
}
......@@ -887,7 +887,7 @@ func builderTest(b *work.Builder, p *load.Package) (buildAction, runAction, prin
// 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 {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment