]> Cypherpunks repositories - gostls13.git/commitdiff
bufio: remove unused 'panicked' variable from test
authorAndrew Gerrand <adg@golang.org>
Thu, 6 Nov 2014 04:22:29 +0000 (15:22 +1100)
committerAndrew Gerrand <adg@golang.org>
Thu, 6 Nov 2014 04:22:29 +0000 (15:22 +1100)
LGTM=r
R=r
CC=golang-codereviews
https://golang.org/cl/166230044

src/bufio/scan_test.go

index bf888dafb585618c2c7f10f7325a53697a6cf1e5..eea87cbf7b39de26059bb7f1dd673b37820d868e 100644 (file)
@@ -467,15 +467,12 @@ func TestDontLoopForever(t *testing.T) {
        s := NewScanner(strings.NewReader("abc"))
        s.Split(loopAtEOFSplit)
        // Expect a panic
-       panicked := true
        defer func() {
                err := recover()
                if err == nil {
                        t.Fatal("should have panicked")
                }
-               if msg, ok := err.(string); ok && strings.Contains(msg, "empty tokens") {
-                       panicked = true
-               } else {
+               if msg, ok := err.(string); !ok || !strings.Contains(msg, "empty tokens") {
                        panic(err)
                }
        }()