MCPcopy Index your code
hub / github.com/go-errors/errors / BenchmarkStackFormat

Function BenchmarkStackFormat

error_test.go:13–31  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

11)
12
13func BenchmarkStackFormat(b *testing.B) {
14 b.ReportAllocs()
15
16 for i := 0; i < b.N; i++ {
17 func() {
18 defer func() {
19 err := recover()
20 if err != 'a' {
21 b.Fatal(err)
22 }
23
24 e := Errorf("hi")
25 _ = string(e.Stack())
26 }()
27
28 a()
29 }()
30 }
31}
32
33func TestAs(t *testing.T) {
34 var errStrIn errorString = "TestForFun"

Callers

nothing calls this directly

Calls 3

ErrorfFunction · 0.85
aFunction · 0.85
StackMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…