QueryInt get query key with int format if not exists or not int type, return 0
(key string)
| 379 | // QueryInt get query key with int format |
| 380 | // if not exists or not int type, return 0 |
| 381 | func (ctx *HttpContext) QueryInt(key string) int { |
| 382 | param := ctx.request.QueryString(key) |
| 383 | if param == "" { |
| 384 | return 0 |
| 385 | } |
| 386 | val, err := strconv.Atoi(param) |
| 387 | if err != nil { |
| 388 | return 0 |
| 389 | } |
| 390 | return val |
| 391 | } |
| 392 | |
| 393 | // QueryInt64 get query key with int64 format |
| 394 | // if not exists or not int64 type, return 0 |
nothing calls this directly
no test coverage detected