From: Russ Cox Date: Thu, 8 Jun 2017 14:17:47 +0000 (-0400) Subject: cmd/go: change testMainDeps from map to slice X-Git-Tag: go1.10beta1~1474 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=e2c30e1fc5157a7c8aff5d8c41b263b30aa5b372;p=gostls13.git 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 TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- diff --git a/src/cmd/go/internal/test/test.go b/src/cmd/go/internal/test/test.go index ebebffd777..d7cc6bd5bd 100644 --- a/src/cmd/go/internal/test/test.go +++ b/src/cmd/go/internal/test/test.go @@ -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 {