toJSON converts ComponentResultsDisplay to JSON format
()
| 1242 | |
| 1243 | // toJSON converts ComponentResultsDisplay to JSON format |
| 1244 | func (d ComponentResultsDisplay) toJSON() ([]byte, error) { |
| 1245 | report := d.toVSASectionsReport() |
| 1246 | data, err := json.MarshalIndent(&report, "", " ") |
| 1247 | if err != nil { |
| 1248 | return nil, fmt.Errorf("failed to marshal to JSON: %w", err) |
| 1249 | } |
| 1250 | return data, nil |
| 1251 | } |
| 1252 | |
| 1253 | // toYAML converts ComponentResultsDisplay to YAML format |
| 1254 | func (d ComponentResultsDisplay) toYAML() ([]byte, error) { |
no test coverage detected