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

Method Get

tree.go:29–36  ·  tree.go::Params.Get

Get returns the value of the first Param which key matches the given name and a boolean true. If no matching Param is found, an empty string is returned and a boolean false .

(name string)

Source from the content-addressed store, hash-verified

27// Get returns the value of the first Param which key matches the given name and a boolean true.
28// If no matching Param is found, an empty string is returned and a boolean false .
29func (ps Params) Get(name string) (string, bool) {
30 for _, entry := range ps {
31 if entry.Key == name {
32 return entry.Value, true
33 }
34 }
35 return "", false
36}
37
38// ByName returns the value of the first Param which key matches the given name.
39// If no matching Param is found, an empty string is returned.

Callers 15

ByNameMethod · 0.95
TestContextFileFunction · 0.45
TestContextSetGetFunction · 0.45
TestContextSetGetAnyKeyFunction · 0.45
TestSetGetDeleteFunction · 0.45
TestContextSetCookieFunction · 0.45
TestContextRenderJSONFunction · 0.45
TestContextRenderJSONPFunction · 0.45
TestContextRenderAPIJSONFunction · 0.45

Calls

no outgoing calls

Tested by 15

TestContextFileFunction · 0.36
TestContextSetGetFunction · 0.36
TestContextSetGetAnyKeyFunction · 0.36
TestSetGetDeleteFunction · 0.36
TestContextSetCookieFunction · 0.36
TestContextRenderJSONFunction · 0.36
TestContextRenderJSONPFunction · 0.36
TestContextRenderAPIJSONFunction · 0.36