diff options
author | Shenghou Ma <minux.ma@gmail.com> | 2012-01-19 10:19:33 -0800 |
---|---|---|
committer | Rob Pike <r@golang.org> | 2012-01-19 10:19:33 -0800 |
commit | d888ab80a308e30b326a3303cc8c611ca22b9988 (patch) | |
tree | 434c657e8fb5ded5876e0aabe46de5c2963f2f68 | |
parent | e5c1f3870b1f0c23b851eaa0a9ffc38e8d8cac6b (diff) | |
download | go-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.go | 7 |
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 { |