MCPcopy Index your code
hub / github.com/perkeep/perkeep / MustGet

Function MustGet

internal/httputil/httputil.go:221–230  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.
221func 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.

Callers 2

serveSignerAttrValueMethod · 0.92
MustGetBlobRefFunction · 0.85

Calls 2

IsGetFunction · 0.85
MissingParameterErrorTypeAlias · 0.85

Tested by

no test coverage detected