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)
| 741 | |
| 742 | // getReqStringOrEmpty returns string from req for key or altKey; ok is true if key exists (even if empty). |
| 743 | func 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. |
| 754 | func getReqBool(req map[string]interface{}, key, altKey string) (bool, bool) { |
no outgoing calls
no test coverage detected