MustGet returns a non-empty GET (or HEAD) parameter param and panics with a special error as caught by a deferred httputil.Recover.
(req *http.Request, param string)
| 219 | // MustGet returns a non-empty GET (or HEAD) parameter param and panics |
| 220 | // with a special error as caught by a deferred httputil.Recover. |
| 221 | func MustGet(req *http.Request, param string) string { |
| 222 | if !IsGet(req) { |
| 223 | panic(InvalidMethodError{}) |
| 224 | } |
| 225 | v := req.FormValue(param) |
| 226 | if v == "" { |
| 227 | panic(MissingParameterError(param)) |
| 228 | } |
| 229 | return v |
| 230 | } |
| 231 | |
| 232 | // MustGetBlobRef returns a non-nil BlobRef from req, as given by param. |
| 233 | // If it doesn't, it panics with a value understood by Recover or RecoverJSON. |
no test coverage detected