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

Method Get

context.go:288–293  ·  view source on GitHub ↗

Get returns the value for the given key, ie: (value, true). If the value does not exist it returns (nil, false)

(key any)

Source from the content-addressed store, hash-verified

286// Get returns the value for the given key, ie: (value, true).
287// If the value does not exist it returns (nil, false)
288func (c *Context) Get(key any) (value any, exists bool) {
289 c.mu.RLock()
290 defer c.mu.RUnlock()
291 value, exists = c.Keys[key]
292 return
293}
294
295// MustGet returns the value for the given key if it exists, otherwise it panics.
296func (c *Context) MustGet(key any) any {

Callers 6

TestContextWithKeysMutexFunction · 0.95
MustGetMethod · 0.95
ShouldBindBodyWithMethod · 0.95
ValueMethod · 0.95
getTypedFunction · 0.45
requestHeaderMethod · 0.45

Calls

no outgoing calls

Tested by 1

TestContextWithKeysMutexFunction · 0.76