Skip to content

Commit d4a45b1

Browse files
committed
fix(stacktrace): partial revert of #ad72a71 where we changed the way to exclude oops stack from stacktrace
1 parent 5e8573e commit d4a45b1

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

stacktrace.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ package oops
22

33
import (
44
"fmt"
5+
"reflect"
56
"runtime"
6-
"runtime/debug"
77
"strings"
88
)
99

@@ -13,10 +13,12 @@ import (
1313
/// -> Apache 2.0 LICENSE
1414
///
1515

16+
type fake struct{}
17+
1618
var (
1719
StackTraceMaxDepth int = 10
1820

19-
buildInfo, _ = debug.ReadBuildInfo()
21+
packageName = reflect.TypeOf(fake{}).PkgPath()
2022
)
2123

2224
type oopsStacktraceFrame struct {
@@ -99,7 +101,6 @@ func newStacktrace(span string) *oopsStacktrace {
99101
}
100102
function := shortFuncName(f)
101103

102-
packageName := buildInfo.Path
103104
packageNameExamples := packageName + "/examples/"
104105

105106
isGoPkg := len(runtime.GOROOT()) > 0 && strings.Contains(file, runtime.GOROOT()) // skip frames in GOROOT if it's set

0 commit comments

Comments
 (0)