From e81e91f79557ed5c4c9c98eef9941d70c7210218 Mon Sep 17 00:00:00 2001 From: donnie4w Date: Tue, 1 Oct 2024 11:25:48 +0800 Subject: [PATCH] Update stack.go --- logger/stack.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/logger/stack.go b/logger/stack.go index 5e0d381..60b7390 100644 --- a/logger/stack.go +++ b/logger/stack.go @@ -53,9 +53,9 @@ func collectCallStack(depth int, formatfunc bool, stack *callStack, recursion bo } var f runtime.Frame var ok bool - if f, ok = m.Get(pcs); !ok { + if f, ok = m.Get(pcs[0]); !ok { f, _ = runtime.CallersFrames([]uintptr{pcs[0]}).Next() - m.Put(pcs, f) + m.Put(pcs[0], f) } if formatfunc { stack.PushWithFunc(f.File, f.Line, funcname(f.Func.Name()))