Improves Copy() in gin.Context

This commit is contained in:
Manu Mtz-Almeida 2014-07-03 16:35:20 +02:00
parent d7a3fdcd8f
commit 12fa9fe499
1 changed files with 2 additions and 3 deletions

5
gin.go
View File

@ -270,11 +270,10 @@ func (group *RouterGroup) combineHandlers(handlers []HandlerFunc) []HandlerFunc
/************************************/ /************************************/
func (c *Context) Copy() *Context { func (c *Context) Copy() *Context {
cp := &Context{} var cp Context = *c
*cp = *c
cp.index = AbortIndex cp.index = AbortIndex
cp.handlers = nil cp.handlers = nil
return cp return &cp
} }
// Next should be used only in the middlewares. // Next should be used only in the middlewares.