improve package gerror

This commit is contained in:
John Guo
2020-12-11 01:08:15 +08:00
parent 1d1e64b834
commit 0ca305a1bf
3 changed files with 19 additions and 0 deletions

View File

@ -12,10 +12,12 @@ import "runtime"
type stack []uintptr
const (
// maxStackDepth marks the max stack depth for error back traces.
maxStackDepth = 32
)
// callers returns the stack callers.
// Note that it here just retrieves the caller memory address array not the caller information.
func callers(skip ...int) stack {
var (
pcs [maxStackDepth]uintptr