Fix context.Copy() race condition (#1020)
* Fix context.Copy race condition * Update githubapi_test.go * fix code format
This commit is contained in:
@ -82,6 +82,10 @@ func (c *Context) Copy() *Context {
|
||||
cp.Writer = &cp.writermem
|
||||
cp.index = abortIndex
|
||||
cp.handlers = nil
|
||||
cp.Keys = map[string]interface{}{}
|
||||
for k, v := range c.Keys {
|
||||
cp.Keys[k] = v
|
||||
}
|
||||
return &cp
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user