From 4e97c01e00c4ff21116d9dae834c73d4f310dcff Mon Sep 17 00:00:00 2001 From: "fj.jin" Date: Mon, 16 Nov 2020 13:49:30 +0800 Subject: [PATCH] init context struct --- gin.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gin.go b/gin.go index 07315170..5d6652ac 100644 --- a/gin.go +++ b/gin.go @@ -165,7 +165,10 @@ func Default() *Engine { func (engine *Engine) allocateContext() *Context { 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.