From 216226acae7848fb825a12b57f6bab1007e31ceb Mon Sep 17 00:00:00 2001 From: Youssef Ayman Date: Mon, 23 Jun 2025 16:06:34 +0300 Subject: [PATCH] feat: add new function to get engine from Context type --- context.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/context.go b/context.go index bf12830c..4deff3ea 100644 --- a/context.go +++ b/context.go @@ -93,6 +93,14 @@ type Context struct { sameSite http.SameSite } +// Get Engine from Context to handle contexts +func (c *Context) GetEngine() *Engine { + if c.engine == nil { + panic("context engine is nil") + } + return c.engine +} + /************************************/ /********** CONTEXT CREATION ********/ /************************************/