From e2c30e1fc5157a7c8aff5d8c41b263b30aa5b372 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Thu, 8 Jun 2017 10:17:47 -0400 Subject: [PATCH] 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 --- src/cmd/go/internal/test/test.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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 { -- 2.48.1