From 2a4c0bd1b99cea55e0a35f83a587f814dc2af24e Mon Sep 17 00:00:00 2001 From: Patrick Ohly Date: Fri, 30 Aug 2019 17:15:37 +0200 Subject: [PATCH] stack backtrace: fix skipping (#600) The full backtrace included one entry too many. This only mattered when that entry wasn't in Ginkgo itself, because otherwise pruning removed it. --- internal/codelocation/code_location.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/codelocation/code_location.go b/internal/codelocation/code_location.go index f8e6179bb..aa89d6cba 100644 --- a/internal/codelocation/code_location.go +++ b/internal/codelocation/code_location.go @@ -11,7 +11,7 @@ import ( func New(skip int) types.CodeLocation { _, file, line, _ := runtime.Caller(skip + 1) - stackTrace := PruneStack(string(debug.Stack()), skip) + stackTrace := PruneStack(string(debug.Stack()), skip+1) return types.CodeLocation{FileName: file, LineNumber: line, FullStackTrace: stackTrace} }