From d888ab80a308e30b326a3303cc8c611ca22b9988 Mon Sep 17 00:00:00 2001 From: Shenghou Ma Date: Thu, 19 Jan 2012 10:19:33 -0800 Subject: [PATCH] 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 --- src/pkg/testing/example.go | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/pkg/testing/example.go b/src/pkg/testing/example.go index fdeda137e76..7f8ff2d0541 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 {