MCPcopy Index your code
hub / github.com/PatchMon/PatchMon / getReqStringOrEmpty

Function getReqStringOrEmpty

server-source-code/internal/handler/settings.go:743–751  ·  view source on GitHub ↗

getReqStringOrEmpty returns string from req for key or altKey; ok is true if key exists (even if empty).

(req map[string]interface{}, key, altKey string)

Source from the content-addressed store, hash-verified

741
742// getReqStringOrEmpty returns string from req for key or altKey; ok is true if key exists (even if empty).
743func getReqStringOrEmpty(req map[string]interface{}, key, altKey string) (string, bool) {
744 if v, ok := req[key].(string); ok {
745 return v, true
746 }
747 if v, ok := req[altKey].(string); ok {
748 return v, true
749 }
750 return "", false
751}
752
753// getReqBool returns bool from req for key or altKey.
754func getReqBool(req map[string]interface{}, key, altKey string) (bool, bool) {

Callers 3

applyOidcSettingsUpdateFunction · 0.85
applySettingsUpdateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected