MCPcopy
hub / github.com/gin-gonic/gin / reset

Method reset

context.go:103–118  ·  view source on GitHub ↗

************************************/ ********** CONTEXT CREATION ********/ ************************************/

()

Source from the content-addressed store, hash-verified

101/************************************/
102
103func (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.

Callers 6

TestContextResetFunction · 0.45
ServeHTTPMethod · 0.45
HandleContextMethod · 0.45
CreateTestContextFunction · 0.45
CreateTestContextOnlyFunction · 0.45

Calls

no outgoing calls

Tested by 2

TestContextResetFunction · 0.36