MCPcopy Create free account
hub / github.com/devfeel/dotweb / QueryInt

Method QueryInt

context.go:381–391  ·  view source on GitHub ↗

QueryInt get query key with int format if not exists or not int type, return 0

(key string)

Source from the content-addressed store, hash-verified

379// QueryInt get query key with int format
380// if not exists or not int type, return 0
381func (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

Callers

nothing calls this directly

Calls 1

QueryStringMethod · 0.65

Tested by

no test coverage detected