mirror of
https://gitee.com/johng/gf
synced 2026-06-06 16:21:40 +08:00
15 lines
243 B
Go
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
|
|
}
|