v0.0.188 exerr MVP

This commit is contained in:
2023-07-24 10:42:39 +02:00
parent b1d6509294
commit 2e6ca48d22
14 changed files with 660 additions and 118 deletions

14
exerr/stacktrace.go Normal file
View File

@@ -0,0 +1,14 @@
package exerr
import (
"fmt"
"runtime"
)
func callername(skip int) string {
pc := make([]uintptr, 15)
n := runtime.Callers(skip+2, pc)
frames := runtime.CallersFrames(pc[:n])
frame, _ := frames.Next()
return fmt.Sprintf("%s:%d %s", frame.File, frame.Line, frame.Function)
}