Files
gf/g/errors/gerror/gerror_stack.go
2019-06-30 12:54:06 +08:00

15 lines
243 B
Go

package gerror
import "runtime"
// stack represents a stack of program counters.
type stack []uintptr
func callers() *stack {
const depth = 32
var pcs [depth]uintptr
n := runtime.Callers(3, pcs[:])
var st stack = pcs[0:n]
return &st
}