Skip to content

Commit

Permalink
fix(stacktrace): partial revert of #ad72a71 where we changed the way …
Browse files Browse the repository at this point in the history
…to exclude oops stack from stacktrace
  • Loading branch information
samber committed Dec 6, 2024
1 parent 5e8573e commit d4a45b1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions stacktrace.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package oops

import (
"fmt"
"reflect"
"runtime"
"runtime/debug"
"strings"
)

Expand All @@ -13,10 +13,12 @@ import (
/// -> Apache 2.0 LICENSE
///

type fake struct{}

var (
StackTraceMaxDepth int = 10

buildInfo, _ = debug.ReadBuildInfo()
packageName = reflect.TypeOf(fake{}).PkgPath()
)

type oopsStacktraceFrame struct {
Expand Down Expand Up @@ -99,7 +101,6 @@ func newStacktrace(span string) *oopsStacktrace {
}
function := shortFuncName(f)

packageName := buildInfo.Path
packageNameExamples := packageName + "/examples/"

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

0 comments on commit d4a45b1

Please sign in to comment.