Files
zeekay 1943f1c093 Hanzo Commerce
Multi-tenant commerce and billing: orders, subscriptions, invoices, plans,
usage metering and a credit ledger. One Go binary. MIT OR Apache-2.0.

Claude-Session: https://claude.ai/code/session_01SAtaDFm8VDiWrhYHNNtxMw
2026-09-23 21:52:16 -07:00

31 lines
571 B
Go

package log
import (
"fmt"
"runtime/debug"
"strings"
)
func errAndStack(err error) string {
return fmt.Sprintf("%v\n%s", err, stack(6))
}
// Grab stacktrace
func stack(offset int) string {
stack := strings.Split(string(debug.Stack()), "\n")
lines := []string{""}
for i := offset; i < len(stack); i++ {
// Skip after ginkgo, framework
if strings.Contains(stack[i], "github.com/onsi/ginkgo") {
break
}
if strings.Contains(stack[i], "github.com/zap-proto/fiber") {
break
}
lines = append(lines, stack[i])
}
return strings.Join(lines, "\n")
}