Skip to content

Commit

Permalink
Merge 288d28d into 91a7462
Browse files Browse the repository at this point in the history
  • Loading branch information
k1LoW authored Nov 19, 2024
2 parents 91a7462 + 288d28d commit 1e282a0
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,19 +58,18 @@ func WithStack(err error) error {
return nil
}

stack := make([]uintptr, MaxStackDepth)
length := runtime.Callers(2, stack[:])

var errws *errorWithStack
if errors.As(err, &errws) {
return err
} else {
errws = &errorWithStack{
Err: err,
stack: stack[:length],
}
}
return errws

stack := make([]uintptr, MaxStackDepth)
length := runtime.Callers(2, stack[:])

return &errorWithStack{
Err: err,
stack: stack[:length],
}
}

// StackTraces returns the stack traces of the given error(s).
Expand Down

0 comments on commit 1e282a0

Please sign in to comment.