(m map[string]interface{}, key string)
| 209 | } |
| 210 | |
| 211 | func jsonNumberOK(m map[string]interface{}, key string) (int64, bool) { |
| 212 | val, ok := m[key].(json.Number) |
| 213 | if !ok { |
| 214 | return 0, false |
| 215 | } |
| 216 | intVal, err := val.Int64() |
| 217 | if err != nil { |
| 218 | return 0, false |
| 219 | } |
| 220 | return intVal, true |
| 221 | } |
| 222 | |
| 223 | // TODO: provide a function in the API module for doing this conversion? |
| 224 | func (c *OperatorUsageCommand) parseNamespaceCount(rawVal interface{}) (UsageResponse, error) { |
no outgoing calls
no test coverage detected
searching dependent graphs…