getReqString returns string from req for key or altKey (camelCase fallback).
(req map[string]interface{}, key, altKey string)
| 730 | |
| 731 | // getReqString returns string from req for key or altKey (camelCase fallback). |
| 732 | func getReqString(req map[string]interface{}, key, altKey string) (string, bool) { |
| 733 | if v, ok := req[key].(string); ok && v != "" { |
| 734 | return v, true |
| 735 | } |
| 736 | if v, ok := req[altKey].(string); ok && v != "" { |
| 737 | return v, true |
| 738 | } |
| 739 | return "", false |
| 740 | } |
| 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) { |
no outgoing calls
no test coverage detected