getReqBool returns bool from req for key or altKey.
(req map[string]interface{}, key, altKey string)
| 752 | |
| 753 | // getReqBool returns bool from req for key or altKey. |
| 754 | func getReqBool(req map[string]interface{}, key, altKey string) (bool, bool) { |
| 755 | if v, ok := req[key].(bool); ok { |
| 756 | return v, true |
| 757 | } |
| 758 | if v, ok := req[altKey].(bool); ok { |
| 759 | return v, true |
| 760 | } |
| 761 | return false, false |
| 762 | } |
| 763 | |
| 764 | // getReqFloat64 returns float64 from req for key or altKey (for JSON numbers). |
| 765 | func getReqFloat64(req map[string]interface{}, key, altKey string) (float64, bool) { |
no outgoing calls
no test coverage detected