| // Copyright 2017 The Go Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style |
| // license that can be found in the LICENSE file. |
| if r := recover(); r != nil { |
| pcs := make([]uintptr, 10) |
| n := runtime.Callers(0, pcs) |
| frames := runtime.CallersFrames(pcs) |
| if f.Function == "main.foo" { |
| println("did not expect to see call to foo in stack trace") |
| if r := recover(); r != nil { |
| pcs := make([]uintptr, 10) |
| n := runtime.Callers(0, pcs) |
| frames := runtime.CallersFrames(pcs) |
| if f.Function == "main.bar" { |
| println("did not expect to see call to bar in stack trace") |