]> Cypherpunks repositories - gostls13.git/commitdiff
text/template: check ignored error in a test
authorDaniel Martí <mvdan@mvdan.cc>
Mon, 11 Sep 2017 19:46:11 +0000 (21:46 +0200)
committerDaniel Martí <mvdan@mvdan.cc>
Wed, 13 Sep 2017 15:06:31 +0000 (15:06 +0000)
Found with staticcheck. Not terribly important since the test would
likely fail anyway, but at least it will fail with a better explanation
now.

Change-Id: Ic3f9a94a2152404b7873cc8cd47b6db79d78c2e6
Reviewed-on: https://go-review.googlesource.com/62990
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/text/template/multi_test.go

index 5d8c08f06f1ceaf92586c61b3a544163dddd05c4..5769470ff909e133b815da6fae2d00df83a46398 100644 (file)
@@ -247,6 +247,9 @@ func TestAddParseTree(t *testing.T) {
                t.Fatal(err)
        }
        added, err := root.AddParseTree("c", tree["c"])
+       if err != nil {
+               t.Fatal(err)
+       }
        // Execute.
        var b bytes.Buffer
        err = added.ExecuteTemplate(&b, "a", 0)