]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: change testMainDeps from map to slice
authorRuss Cox <rsc@golang.org>
Thu, 8 Jun 2017 14:17:47 +0000 (10:17 -0400)
committerRuss Cox <rsc@golang.org>
Fri, 18 Aug 2017 14:25:02 +0000 (14:25 +0000)
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: Ian Lance Taylor <iant@golang.org>
src/cmd/go/internal/test/test.go

index ebebffd77777dbce5f864249b5312fb7f42eabb3..d7cc6bd5bde8ab751d3c1ad287650a4c0a7d4410 100644 (file)
@@ -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 {