Fix call of runtime callers (like fix package logger)

This commit is contained in:
Nicolas JUHEL
2020-08-12 11:16:14 +02:00
parent ca3b92b4ac
commit fdb44d2ddf

View File

@@ -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])