printChecksJSON prints the result as JSON to stdout.
(result *ChecksResult)
| 384 | |
| 385 | // printChecksJSON prints the result as JSON to stdout. |
| 386 | func printChecksJSON(result *ChecksResult) error { |
| 387 | enc := json.NewEncoder(os.Stdout) |
| 388 | enc.SetIndent("", " ") |
| 389 | if err := enc.Encode(result); err != nil { |
| 390 | return fmt.Errorf("failed to encode JSON output: %w", err) |
| 391 | } |
| 392 | return nil |
| 393 | } |
| 394 | |
| 395 | // printChecksText prints the result in human-readable form to stderr. |
| 396 | func printChecksText(result *ChecksResult) error { |