MCPcopy Create free account
hub / github.com/bracesdev/errtrace / BenchmarkGetCaller

Function BenchmarkGetCaller

internal/pc/pc_test.go:13–27  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

11}
12
13func BenchmarkGetCaller(b *testing.B) {
14 err := errors.New("test")
15
16 var last uintptr
17 for i := 0; i < b.N; i++ {
18 cur := wrap(err)
19 if cur == 0 {
20 panic("invalid PC")
21 }
22 if last != 0 && cur != last {
23 panic("inconsistent results")
24 }
25 last = cur
26 }
27}

Callers

nothing calls this directly

Calls 1

wrapFunction · 0.70

Tested by

no test coverage detected