From 26301b6cfda5888a625c546e57024ac28336ac18 Mon Sep 17 00:00:00 2001 From: Dave Cheney Date: Tue, 2 Jun 2015 13:21:37 +1000 Subject: [PATCH] cmd/cover: fix missing error check in test Fix missing error check in test. Spotted by Gordon Klass, https://groups.google.com/forum/#!topic/golang-nuts/MdDLbvOjb4o Change-Id: I22f1a438cbb60a2fe1740fc2d43fbf8aa008b6de Reviewed-on: https://go-review.googlesource.com/10605 Reviewed-by: Brad Fitzpatrick --- src/cmd/cover/cover_test.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/cmd/cover/cover_test.go b/src/cmd/cover/cover_test.go index e5cfccf9df..af7ea443cd 100644 --- a/src/cmd/cover/cover_test.go +++ b/src/cmd/cover/cover_test.go @@ -59,7 +59,9 @@ func TestCover(t *testing.T) { for i, line := range lines { lines[i] = bytes.Replace(line, []byte("LINE"), []byte(fmt.Sprint(i+1)), -1) } - err = ioutil.WriteFile(coverInput, bytes.Join(lines, []byte("\n")), 0666) + if err := ioutil.WriteFile(coverInput, bytes.Join(lines, []byte("\n")), 0666); err != nil { + t.Fatal(err) + } // defer removal of test_line.go if !debug { -- 2.48.1