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

Method PostValueInt16Default

context/context.go:2119–2126  ·  view source on GitHub ↗

PostValueInt16Default same as PostValueInt16 but if errored it returns the given "def" default value.

(name string, def int16)

Source from the content-addressed store, hash-verified

2117// PostValueInt16Default same as PostValueInt16 but if errored it returns
2118// the given "def" default value.
2119func (ctx *Context) PostValueInt16Default(name string, def int16) int16 {
2120 value, err := ctx.PostValueInt16(name)
2121 if err != nil {
2122 return def
2123 }
2124
2125 return value
2126}
2127
2128// PostValueInt32 returns the last parsed form data matches the given "name" key
2129// from POST, PATCH, or PUT body request parameters as int32.

Callers

nothing calls this directly

Calls 1

PostValueInt16Method · 0.95

Tested by

no test coverage detected