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

Function getTyped

context.go:303–308  ·  view source on GitHub ↗
(c *Context, key any)

Source from the content-addressed store, hash-verified

301}
302
303func getTyped[T any](c *Context, key any) (res T) {
304 if val, ok := c.Get(key); ok && val != nil {
305 res, _ = val.(T)
306 }
307 return
308}
309
310// GetString returns the value associated with the key as a string.
311func (c *Context) GetString(key any) string {

Callers 15

GetTimeMethod · 0.85
GetDurationMethod · 0.85
GetIntSliceMethod · 0.85
GetInt8SliceMethod · 0.85
GetInt16SliceMethod · 0.85
GetInt32SliceMethod · 0.85
GetInt64SliceMethod · 0.85
GetUintSliceMethod · 0.85
GetUint8SliceMethod · 0.85
GetUint16SliceMethod · 0.85
GetUint32SliceMethod · 0.85
GetUint64SliceMethod · 0.85

Calls 1

GetMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…