MCPcopy
hub / github.com/eyebluecn/tank / ExtractRequestString

Function ExtractRequestString

code/tool/util/util_params.go:12–19  ·  view source on GitHub ↗

param is required. when missing, panic error.

(request *http.Request, key string)

Source from the content-addressed store, hash-verified

10
11// param is required. when missing, panic error.
12func ExtractRequestString(request *http.Request, key string) string {
13 str := request.FormValue(key)
14 if str == "" {
15 panic(fmt.Sprintf("%s is required", key))
16 } else {
17 return str
18 }
19}
20
21// param is required. when missing, panic error.
22func ExtractRequestStringWithErrorHint(request *http.Request, key string, errorHint string) string {

Callers 15

CreateMethod · 0.92
MatterPageMethod · 0.92
CreateMethod · 0.92
EditMethod · 0.92
DeleteMethod · 0.92
DetailMethod · 0.92
MineMethod · 0.92
PageMethod · 0.92
CreateMethod · 0.92
EditMethod · 0.92
DeleteMethod · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected