From: Shenghou Ma Date: Thu, 19 Jan 2012 18:19:33 +0000 (-0800) Subject: testing: do not recover example's panic X-Git-Tag: weekly.2012-01-20~20 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=d888ab80a308e30b326a3303cc8c611ca22b9988;p=gostls13.git testing: do not recover example's panic So as to give out stack trace for panic in examples. This behavior also matches the tests'. Fixes #2691. R=golang-dev CC=golang-dev https://golang.org/cl/5554061 --- diff --git a/src/pkg/testing/example.go b/src/pkg/testing/example.go index fdeda137e7..7f8ff2d054 100644 --- a/src/pkg/testing/example.go +++ b/src/pkg/testing/example.go @@ -25,13 +25,6 @@ func RunExamples(examples []InternalExample) (ok bool) { var eg InternalExample stdout, stderr := os.Stdout, os.Stderr - defer func() { - os.Stdout, os.Stderr = stdout, stderr - if e := recover(); e != nil { - fmt.Printf("--- FAIL: %s\npanic: %v\n", eg.Name, e) - os.Exit(1) - } - }() for _, eg = range examples { if *chatty {