mirror of
https://github.com/gin-gonic/gin.git
synced 2025-10-14 12:12:12 +08:00
feat: add new function to get engine from Context type
This commit is contained in:
parent
cf4775283e
commit
216226acae
@ -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 ********/
|
||||
/************************************/
|
||||
|
Loading…
x
Reference in New Issue
Block a user