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

Method URLParamIntDefault

context/context.go:1599–1606  ·  view source on GitHub ↗

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

(name string, def int)

Source from the content-addressed store, hash-verified

1597// URLParamIntDefault returns the url query parameter as int value from a request,
1598// if not found or parse failed then "def" is returned.
1599func (ctx *Context) URLParamIntDefault(name string, def int) int {
1600 v, err := ctx.URLParamInt(name)
1601 if err != nil {
1602 return def
1603 }
1604
1605 return v
1606}
1607
1608// URLParamInt32Default returns the url query parameter as int32 value from a request,
1609// if not found or parse failed then "def" is returned.

Callers 1

newRequestDep1Function · 0.80

Calls 1

URLParamIntMethod · 0.95

Tested by 1

newRequestDep1Function · 0.64