From ff2b30ff5d25955e02e3c9fefd1b8b236689c211 Mon Sep 17 00:00:00 2001 From: Grant Murphy Date: Fri, 9 Mar 2018 15:28:56 +1000 Subject: [PATCH] Cleanup test output --- testutils/pkg.go | 4 +++- testutils/source.go | 5 ++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/testutils/pkg.go b/testutils/pkg.go index 569cd80..93f789f 100644 --- a/testutils/pkg.go +++ b/testutils/pkg.go @@ -129,6 +129,8 @@ func (p *TestPackage) CreateContext(filename string) *gas.Context { func (p *TestPackage) Close() { if p.ondisk { err := os.RemoveAll(p.Path) - log.Println(err) + if err != nil { + log.Fatal(err) + } } } diff --git a/testutils/source.go b/testutils/source.go index 2fc9bb0..11fe535 100644 --- a/testutils/source.go +++ b/testutils/source.go @@ -473,7 +473,7 @@ body, err := ioutil.ReadFile(f) if err != nil { log.Printf("Error: %v\n", err) } -log.Print(f) +log.Print(body) }`, 1}, {` package main @@ -493,8 +493,7 @@ func main() { fmt.Printf("Error: %v\n", err) } body := make([]byte, 5) - n1, err := f.Read(body) - if err != nil { + if _, err = f.Read(body); err != nil { fmt.Printf("Error: %v\n", err) } fmt.Fprintf(w, "%s", body)