Skip to content

Commit

Permalink
Debug
Browse files Browse the repository at this point in the history
  • Loading branch information
iesreza committed Sep 30, 2022
1 parent 8d143e1 commit f469456
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions evo.context.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ type Request struct {
Response Response
CacheKey string
CacheDuration time.Duration
debug interface{}
debug *bool
flashes []flash
}
type flash struct {
Expand Down Expand Up @@ -77,7 +77,10 @@ func (u *URL) String() string {
}

func Upgrade(ctx *fiber.Ctx) *Request {
r := Request{}
var _false = false
r := Request{
debug: &_false,
}
r.Variables = fiber.Map{}
r.Context = ctx
r.Response = Response{}
Expand All @@ -91,15 +94,11 @@ func Upgrade(ctx *fiber.Ctx) *Request {
}

func (r *Request) Debug() bool {
return r.debug != nil
return *r.debug
}

func (r *Request) SetDebug(debug bool) {
if debug {
r.debug = struct{}{}
return
}
r.debug = nil
r.debug = &debug
}

func (r *Request) Flash(params ...string) {
Expand Down

0 comments on commit f469456

Please sign in to comment.