mirror of
https://github.com/nabbar/golib.git
synced 2025-11-03 09:50:52 +08:00
Fix call of runtime callers (like fix package logger)
This commit is contained in:
@@ -37,8 +37,8 @@ var currPkgs = path.Base(reflect.TypeOf(UNK_ERROR).PkgPath())
|
||||
|
||||
func getFrame() runtime.Frame {
|
||||
// Set size to targetFrameIndex+2 to ensure we have room for one more caller than we need
|
||||
programCounters := make([]uintptr, 0)
|
||||
n := runtime.Callers(0, programCounters)
|
||||
programCounters := make([]uintptr, 10, 255)
|
||||
n := runtime.Callers(1, programCounters)
|
||||
|
||||
if n > 0 {
|
||||
frames := runtime.CallersFrames(programCounters[:n])
|
||||
|
||||
Reference in New Issue
Block a user