FormatJSON formats JSON with syntax highlighting
(data []byte)
| 211 | |
| 212 | // FormatJSON formats JSON with syntax highlighting |
| 213 | func FormatJSON(data []byte) string { |
| 214 | var prettyJSON bytes.Buffer |
| 215 | if err := json.Indent(&prettyJSON, data, "", " "); err != nil { |
| 216 | return string(data) |
| 217 | } |
| 218 | return prettyJSON.String() |
| 219 | } |
| 220 | |
| 221 | // FetchAllPages fetches all pages from a paginated API endpoint. |
| 222 | // It returns all response bodies as a slice, stopping when a page returns |
no outgoing calls
no test coverage detected