From 12fa9fe4993674bd64a3fcbcb298b6e7741aedb5 Mon Sep 17 00:00:00 2001 From: Manu Mtz-Almeida Date: Thu, 3 Jul 2014 16:35:20 +0200 Subject: [PATCH] Improves Copy() in gin.Context --- gin.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/gin.go b/gin.go index ffc9581..3c8e49e 100644 --- a/gin.go +++ b/gin.go @@ -270,11 +270,10 @@ func (group *RouterGroup) combineHandlers(handlers []HandlerFunc) []HandlerFunc /************************************/ func (c *Context) Copy() *Context { - cp := &Context{} - *cp = *c + var cp Context = *c cp.index = AbortIndex cp.handlers = nil - return cp + return &cp } // Next should be used only in the middlewares.