extractList pulls an array of maps from a wrapper object by key.
(wrapper map[string]any, key string)
| 321 | |
| 322 | // extractList pulls an array of maps from a wrapper object by key. |
| 323 | func extractList(wrapper map[string]any, key string) ([]map[string]any, error) { |
| 324 | arr, ok := wrapper[key] |
| 325 | if !ok || arr == nil { |
| 326 | return nil, nil |
| 327 | } |
| 328 | raw, err := json.Marshal(arr) |
| 329 | if err != nil { |
| 330 | return nil, err |
| 331 | } |
| 332 | var result []map[string]any |
| 333 | if err := json.Unmarshal(raw, &result); err != nil { |
| 334 | return nil, err |
| 335 | } |
| 336 | return result, nil |
| 337 | } |
| 338 | |
| 339 | // GetDebug fetches the current debug setting. |
| 340 | func (c *Client) GetDebug() (bool, error) { |
no outgoing calls
no test coverage detected