From 8d143e1fe84a92d487c576677463504edf0183bf Mon Sep 17 00:00:00 2001 From: reza Date: Fri, 30 Sep 2022 12:16:49 +0200 Subject: [PATCH] Debug --- evo.context.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/evo.context.go b/evo.context.go index a17aa900..6fde12a6 100644 --- a/evo.context.go +++ b/evo.context.go @@ -25,7 +25,7 @@ type Request struct { Response Response CacheKey string CacheDuration time.Duration - Debug bool + debug interface{} flashes []flash } type flash struct { @@ -90,8 +90,16 @@ func Upgrade(ctx *fiber.Ctx) *Request { return &r } +func (r *Request) Debug() bool { + return r.debug != nil +} + func (r *Request) SetDebug(debug bool) { - r.Debug = debug + if debug { + r.debug = struct{}{} + return + } + r.debug = nil } func (r *Request) Flash(params ...string) {