From a73d7d165486920ece96d8d433c08e12cd4fd79e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20Schw=C3=B6rer?= Date: Mon, 24 Jul 2023 11:42:52 +0200 Subject: [PATCH] v0.0.195 --- exerr/errinit.go | 18 ++++++++++++++---- goextVersion.go | 4 ++-- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/exerr/errinit.go b/exerr/errinit.go index 6c85760..eadb7cc 100644 --- a/exerr/errinit.go +++ b/exerr/errinit.go @@ -19,8 +19,8 @@ type ErrorPackageConfigInit struct { ZeroLogAllTraces bool RecursiveErrors bool ExtendedGinOutput bool - ExtendGinOutput *func(err *ExErr, json map[string]any) - ExtendGinDataOutput *func(err *ExErr, depth int, json map[string]any) + ExtendGinOutput func(err *ExErr, json map[string]any) + ExtendGinDataOutput func(err *ExErr, depth int, json map[string]any) } var initialized = false @@ -42,13 +42,23 @@ func Init(cfg ErrorPackageConfigInit) { panic("Cannot re-init error package") } + ego := func(err *ExErr, json map[string]any) {} + egdo := func(err *ExErr, depth int, json map[string]any) {} + + if cfg.ExtendGinOutput != nil { + ego = cfg.ExtendGinOutput + } + if cfg.ExtendGinDataOutput != nil { + egdo = cfg.ExtendGinDataOutput + } + pkgconfig = ErrorPackageConfig{ ZeroLogErrTraces: cfg.ZeroLogErrTraces, ZeroLogAllTraces: cfg.ZeroLogAllTraces, RecursiveErrors: cfg.RecursiveErrors, ExtendedGinOutput: cfg.ExtendedGinOutput, - ExtendGinOutput: langext.Coalesce(cfg.ExtendGinOutput, func(err *ExErr, json map[string]any) {}), - ExtendGinDataOutput: langext.Coalesce(cfg.ExtendGinDataOutput, func(err *ExErr, depth int, json map[string]any) {}), + ExtendGinOutput: ego, + ExtendGinDataOutput: egdo, } initialized = true diff --git a/goextVersion.go b/goextVersion.go index 09c8430..c44752d 100644 --- a/goextVersion.go +++ b/goextVersion.go @@ -1,5 +1,5 @@ package goext -const GoextVersion = "0.0.194" +const GoextVersion = "0.0.195" -const GoextVersionTimestamp = "2023-07-24T11:40:47+0200" +const GoextVersionTimestamp = "2023-07-24T11:42:52+0200"