MCPcopy Create free account
hub / github.com/kataras/iris / URLParamBoolDefault

Method URLParamBoolDefault

context/context.go:1695–1702  ·  view source on GitHub ↗

URLParamBoolDefault returns the url query parameter as boolean value from a request, if not found or parse failed then "def" is returned.

(name string, def bool)

Source from the content-addressed store, hash-verified

1693// URLParamBoolDefault returns the url query parameter as boolean value from a request,
1694// if not found or parse failed then "def" is returned.
1695func (ctx *Context) URLParamBoolDefault(name string, def bool) bool {
1696 v, err := ctx.URLParamBool(name)
1697 if err != nil {
1698 return def
1699 }
1700
1701 return v
1702}
1703
1704// URLParams returns a map of URL Query parameters.
1705// If the value of a URL parameter is a slice,

Callers

nothing calls this directly

Calls 1

URLParamBoolMethod · 0.95

Tested by

no test coverage detected