aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShenghou Ma <minux.ma@gmail.com>2012-01-19 10:19:33 -0800
committerRob Pike <r@golang.org>2012-01-19 10:19:33 -0800
commitd888ab80a308e30b326a3303cc8c611ca22b9988 (patch)
tree434c657e8fb5ded5876e0aabe46de5c2963f2f68
parente5c1f3870b1f0c23b851eaa0a9ffc38e8d8cac6b (diff)
downloadgo-d888ab80a308e30b326a3303cc8c611ca22b9988.tar.gz
go-d888ab80a308e30b326a3303cc8c611ca22b9988.zip
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
-rw-r--r--src/pkg/testing/example.go7
1 files changed, 0 insertions, 7 deletions
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 {