12 func noErrors(at, depth int) error {
14 return stderrors.New("no error")
16 return noErrors(at+1, depth)
19 func yesErrors(at, depth int) error {
21 return New("ye error")
23 return yesErrors(at+1, depth)
26 // GlobalE is an exported global to store the result of benchmark results,
27 // preventing the compiler from optimising the benchmark functions away.
30 func BenchmarkErrors(b *testing.B) {
43 for _, r := range runs {
48 name := fmt.Sprintf("%s-stack-%d", part, r.stack)
49 b.Run(name, func(b *testing.B) {
56 for i := 0; i < b.N; i++ {