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

Method ByName

tree.go:40–43  ·  tree.go::Params.ByName

ByName returns the value of the first Param which key matches the given name. If no matching Param is found, an empty string is returned.

(name string)

Source from the content-addressed store, hash-verified

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.
40func (ps Params) ByName(name string) (va string) {
41 va, _ = ps.Get(name)
42 return
43}
44
45type methodTree struct {
46 method string

Callers 6

TestRouteParamsByNameFunction · 0.80
TestRouteParamsNotEmptyFunction · 0.80
TestRouteRawPathFunction · 0.80
ParamMethod · 0.80

Calls 1

GetMethod · 0.95

Tested by 5

TestRouteParamsByNameFunction · 0.64
TestRouteParamsNotEmptyFunction · 0.64
TestRouteRawPathFunction · 0.64