]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/cover: fix missing error check in test
authorDave Cheney <dave@cheney.net>
Tue, 2 Jun 2015 03:21:37 +0000 (13:21 +1000)
committerDave Cheney <dave@cheney.net>
Tue, 2 Jun 2015 05:23:55 +0000 (05:23 +0000)
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 <bradfitz@golang.org>
src/cmd/cover/cover_test.go

index e5cfccf9df980d71e2116346b7f63519f7e233be..af7ea443cd5bf71beaaf723c6e79dfc8f8eca405 100644 (file)
@@ -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 {