getStr retrieves a string value from a map, returning an empty string if not found or not a string.
(m map[string]interface{}, key string)
| 276 | |
| 277 | // getStr retrieves a string value from a map, returning an empty string if not found or not a string. |
| 278 | func getStr(m map[string]interface{}, key string) string { |
| 279 | if v, ok := m[key]; ok { |
| 280 | if s, ok := v.(string); ok { |
| 281 | return s |
| 282 | } |
| 283 | } |
| 284 | return "" |
| 285 | } |
| 286 | |
| 287 | // getInt retrieves an integer value from a map, returning a fallback value if not found or not a number. |
| 288 | func getInt(m map[string]interface{}, key string, fallback int) int { |
no outgoing calls
no test coverage detected