From 1bbd1952f44ebcee8a6d510d150fb2fec14eff8f Mon Sep 17 00:00:00 2001 From: Wittano Bonarotti Date: Wed, 15 May 2024 21:22:11 +0200 Subject: [PATCH] chore: fixed type name --- log/types.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/log/types.go b/log/types.go index 94440e8..255fe46 100644 --- a/log/types.go +++ b/log/types.go @@ -8,7 +8,7 @@ import ( const RequestIDKey = "requestID" -type LogFunc func(l slog.Logger) +type Func func(l slog.Logger) type Context struct { Logger *slog.Logger @@ -53,10 +53,8 @@ func NewContext(uuid string) Context { } } -func Log(ctx context.Context, logFunc LogFunc) { - loggerCtx, ok := ctx.(Context) - - if ok { +func Log(ctx context.Context, logFunc Func) { + if loggerCtx, ok := ctx.(Context); ok { logFunc(*loggerCtx.Logger) } else { logFunc(*slog.Default())