File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -24,8 +24,6 @@ import (
2424 "github.com/stretchr/testify/assert/yaml"
2525)
2626
27- const stackFrameBufferSize = 10
28-
2927//go:generate sh -c "cd ../_codegen && go build && cd - && ../_codegen/_codegen -output-package=assert -template=assertion_format.go.tmpl"
3028
3129// TestingT is an interface wrapper around *testing.T
@@ -217,8 +215,10 @@ func CallerInfo() []string {
217215 var line int
218216 var name string
219217
220- callers := [] string {}
218+ const stackFrameBufferSize = 10
221219 pcs := make ([]uintptr , stackFrameBufferSize )
220+
221+ callers := []string {}
222222 offset := 1
223223
224224 for {
@@ -273,13 +273,14 @@ func CallerInfo() []string {
273273 isTest (name , "Example" ) {
274274 break
275275 }
276+
276277 if ! more {
277278 break
278279 }
279280 }
280- // We know we already have less than a buffer's worth of frames
281- offset += stackFrameBufferSize
282281
282+ // Next batch
283+ offset += cap (pcs )
283284 }
284285
285286 return callers
You can’t perform that action at this time.
0 commit comments