From ffb96e5a6d72bfa2354faebcb0665c776ffb6fcb Mon Sep 17 00:00:00 2001 From: Filip Grzadkowski Date: Wed, 17 Jun 2015 22:21:18 +0200 Subject: [PATCH] Fix variable binding bug when saving logs --- test/e2e/core.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/e2e/core.go b/test/e2e/core.go index 346068058df..2a141bd9a08 100644 --- a/test/e2e/core.go +++ b/test/e2e/core.go @@ -76,7 +76,7 @@ func logCore(cmds []command, hosts []string, dir, provider string) { fmt.Printf("SSH'ing to all nodes and running %s\n", cmd.cmd) for _, host := range hosts { wg.Add(1) - go func() { + go func(cmd command, host string) { defer wg.Done() logfile := fmt.Sprintf("%s/%s-%s.log", dir, host, cmd.component) fmt.Printf("Writing to %s.\n", logfile) @@ -87,7 +87,7 @@ func logCore(cmds []command, hosts []string, dir, provider string) { if err := ioutil.WriteFile(logfile, []byte(stdout+stderr), 0777); err != nil { fmt.Printf("Error writing logfile: %v\n", err) } - }() + }(cmd, host) } } wg.Wait()