From 664f66105bc9bc38969db987d63527de24ad51b7 Mon Sep 17 00:00:00 2001 From: verytable Date: Sun, 2 Feb 2020 01:21:12 +0300 Subject: [PATCH] Use cmd.Run instead of cmd.Start+cmd.Wait. --- tools/testtool/commands/test_submission.go | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/tools/testtool/commands/test_submission.go b/tools/testtool/commands/test_submission.go index 8154d6f..d8e3e41 100644 --- a/tools/testtool/commands/test_submission.go +++ b/tools/testtool/commands/test_submission.go @@ -131,12 +131,8 @@ func copyDir(src, dst string) { cmd.Stdout = os.Stdout cmd.Stderr = os.Stderr - if err := cmd.Start(); err != nil { - log.Fatalf("error starting rsync command: %s", err) - } - - if err := cmd.Wait(); err != nil { - log.Fatalf("rsync command failed: %s", err) + if err := cmd.Run(); err != nil { + log.Fatalf("directory copying failed: %s", err) } } @@ -155,11 +151,7 @@ func copyFiles(baseDir string, relPaths []string, dst string) { cmd.Stdout = os.Stdout cmd.Stderr = os.Stderr - if err := cmd.Start(); err != nil { - log.Fatalf("error starting file copying: %s", err) - } - - if err := cmd.Wait(); err != nil { + if err := cmd.Run(); err != nil { log.Fatalf("file copying failed: %s", err) } } @@ -173,11 +165,7 @@ func runTests(testDir string) { cmd.Stdout = os.Stdout cmd.Stderr = os.Stderr - if err := cmd.Start(); err != nil { - log.Fatalf("error starting go test command: %s", err) - } - - if err := cmd.Wait(); err != nil { + if err := cmd.Run(); err != nil { log.Fatalf("go test command failed: %s", err) } }