From: Andrew Gerrand Date: Thu, 6 Nov 2014 04:22:29 +0000 (+1100) Subject: bufio: remove unused 'panicked' variable from test X-Git-Tag: go1.4rc1~43 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=908dcab6f854503a4616b6a20aa1e9eba9ecea66;p=gostls13.git bufio: remove unused 'panicked' variable from test LGTM=r R=r CC=golang-codereviews https://golang.org/cl/166230044 --- diff --git a/src/bufio/scan_test.go b/src/bufio/scan_test.go index bf888dafb5..eea87cbf7b 100644 --- a/src/bufio/scan_test.go +++ b/src/bufio/scan_test.go @@ -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) } }()