************************************/ ********** CONTEXT CREATION ********/ ************************************/
()
| 101 | /************************************/ |
| 102 | |
| 103 | func (c *Context) reset() { |
| 104 | c.Writer = &c.writermem |
| 105 | c.Params = c.Params[:0] |
| 106 | c.handlers = nil |
| 107 | c.index = -1 |
| 108 | |
| 109 | c.fullPath = "" |
| 110 | c.Keys = nil |
| 111 | c.Errors = c.Errors[:0] |
| 112 | c.Accepted = nil |
| 113 | c.queryCache = nil |
| 114 | c.formCache = nil |
| 115 | c.sameSite = 0 |
| 116 | *c.params = (*c.params)[:0] |
| 117 | *c.skippedNodes = (*c.skippedNodes)[:0] |
| 118 | } |
| 119 | |
| 120 | // Copy returns a copy of the current context that can be safely used outside the request's scope. |
| 121 | // This has to be used when the context has to be passed to a goroutine. |
no outgoing calls