PostValueIntDefault same as PostValueInt but if errored it returns the given "def" default value.
(name string, def int)
| 2069 | // PostValueIntDefault same as PostValueInt but if errored it returns |
| 2070 | // the given "def" default value. |
| 2071 | func (ctx *Context) PostValueIntDefault(name string, def int) int { |
| 2072 | value, err := ctx.PostValueInt(name) |
| 2073 | if err != nil { |
| 2074 | return def |
| 2075 | } |
| 2076 | |
| 2077 | return value |
| 2078 | } |
| 2079 | |
| 2080 | // PostValueInt8 returns the last parsed form data matches the given "name" key |
| 2081 | // from POST, PATCH, or PUT body request parameters as int8. |
nothing calls this directly
no test coverage detected