diff options
| author | Andrew Gerrand <adg@golang.org> | 2014-11-06 15:22:29 +1100 |
|---|---|---|
| committer | Andrew Gerrand <adg@golang.org> | 2014-11-06 15:22:29 +1100 |
| commit | 908dcab6f854503a4616b6a20aa1e9eba9ecea66 (patch) | |
| tree | f5b7226a885f737d1a470cb8e7608fec793a5d21 /src/bufio/scan_test.go | |
| parent | 39bcbb353c6bf2e13eb0d3585fe82d3cab6df78d (diff) | |
| download | go-908dcab6f854503a4616b6a20aa1e9eba9ecea66.tar.xz | |
bufio: remove unused 'panicked' variable from test
LGTM=r
R=r
CC=golang-codereviews
https://golang.org/cl/166230044
Diffstat (limited to 'src/bufio/scan_test.go')
| -rw-r--r-- | src/bufio/scan_test.go | 5 |
1 files changed, 1 insertions, 4 deletions
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) } }() |
