From e05efe0571474e9f9704fc2145c5e0a1ce55e418 Mon Sep 17 00:00:00 2001 From: gedi Date: Tue, 16 Oct 2018 17:34:53 +0300 Subject: [PATCH] closes #142 --- builder_go110.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/builder_go110.go b/builder_go110.go index d8a8a7b..c124863 100644 --- a/builder_go110.go +++ b/builder_go110.go @@ -92,10 +92,12 @@ func Build(bin string) error { // since we do not need it for godog suite. // we also print back the temp WORK directory // go has built. We will reuse it for our suite workdir. - out, err = exec.Command("go", "test", "-c", "-work", "-o", os.DevNull).CombinedOutput() + temp := fmt.Sprintf(filepath.Join("%s", "temp-%d.test"), os.TempDir(), time.Now().UnixNano()) + out, err = exec.Command("go", "test", "-c", "-work", "-o", temp).CombinedOutput() if err != nil { return fmt.Errorf("failed to compile tested package: %s, reason: %v, output: %s", pkg.Name, err, string(out)) } + defer os.Remove(temp) // extract go-build temporary directory as our workdir lines := strings.Split(strings.TrimSpace(string(out)), "\n")