MCPcopy Index your code
hub / github.com/labstack/echo / QueryParam

Method QueryParam

context.go:337–345  ·  view source on GitHub ↗

QueryParam returns the query param for the provided name.

(name string)

Source from the content-addressed store, hash-verified

335
336// QueryParam returns the query param for the provided name.
337func (c *Context) QueryParam(name string) string {
338 // If the full query map was already built (e.g. by QueryParams), use it. Otherwise look the single
339 // key up directly from the raw query, avoiding the url.Values map allocation for the common case of
340 // reading only a few params. The result is identical to url.Values.Get on the parsed query.
341 if c.query != nil {
342 return c.query.Get(name)
343 }
344 return getRawQueryParam(c.request.URL.RawQuery, name)
345}
346
347// getRawQueryParam returns the first value for name parsed directly from a raw URL query string. It
348// matches url.Values.Get over url.ParseQuery output: first match wins, '+' decodes to space, percent

Callers 5

TestContext_QueryParamFunction · 0.95
QueryParamOrMethod · 0.95
MethodFromQueryFunction · 0.80
TestServeWithHandlerFunction · 0.80

Calls 2

getRawQueryParamFunction · 0.85
GetMethod · 0.45

Tested by 3

TestContext_QueryParamFunction · 0.76
TestServeWithHandlerFunction · 0.64