(r *http.Request, key string, def int)
| 64 | } |
| 65 | |
| 66 | func parseIntQuery(r *http.Request, key string, def int) int { |
| 67 | s := r.URL.Query().Get(key) |
| 68 | if s == "" { |
| 69 | return def |
| 70 | } |
| 71 | n, err := strconv.Atoi(s) |
| 72 | if err != nil || n < 1 { |
| 73 | return def |
| 74 | } |
| 75 | return n |
| 76 | } |
no test coverage detected