(c APIClient)
| 96 | } |
| 97 | |
| 98 | func getConfig(c APIClient) (config.Configuration, error) { |
| 99 | cfg := config.Configuration{} |
| 100 | response, err := c.Get("system/config") |
| 101 | if err != nil { |
| 102 | return cfg, err |
| 103 | } |
| 104 | bytes, err := responseToBArray(response) |
| 105 | if err != nil { |
| 106 | return cfg, err |
| 107 | } |
| 108 | err = json.Unmarshal(bytes, &cfg) |
| 109 | if err != nil { |
| 110 | return config.Configuration{}, err |
| 111 | } |
| 112 | return cfg, nil |
| 113 | } |
| 114 | |
| 115 | func prettyPrintJSON(data interface{}) error { |
| 116 | enc := json.NewEncoder(os.Stdout) |
no test coverage detected