mirror of
https://github.com/gin-gonic/gin.git
synced 2025-10-18 06:42:10 +08:00
init context struct
This commit is contained in:
parent
6e5017ad0f
commit
4e97c01e00
5
gin.go
5
gin.go
@ -165,7 +165,10 @@ func Default() *Engine {
|
|||||||
|
|
||||||
func (engine *Engine) allocateContext() *Context {
|
func (engine *Engine) allocateContext() *Context {
|
||||||
v := make(Params, 0, engine.maxParams)
|
v := make(Params, 0, engine.maxParams)
|
||||||
return &Context{engine: engine, params: &v}
|
c := &Context{engine: engine, params: &v}
|
||||||
|
// init context struct
|
||||||
|
c.reset()
|
||||||
|
return c
|
||||||
}
|
}
|
||||||
|
|
||||||
// Delims sets template left and right delims and returns a Engine instance.
|
// Delims sets template left and right delims and returns a Engine instance.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user