MCPcopy Create free account
hub / github.com/conforma/cli / toText

Method toText

cmd/validate/vsa.go:1284–1297  ·  view source on GitHub ↗

toText converts ComponentResultsDisplay to text format using existing String() methods This reuses the existing formatting logic and avoids code duplication

()

Source from the content-addressed store, hash-verified

1282// toText converts ComponentResultsDisplay to text format using existing String() methods
1283// This reuses the existing formatting logic and avoids code duplication
1284func (d ComponentResultsDisplay) toText() []byte {
1285 var b strings.Builder
1286 b.WriteString(d.Header.String())
1287 b.WriteString("\n")
1288 b.WriteString(d.Result.String())
1289 b.WriteString("\n")
1290 b.WriteString(d.VSASummary.String())
1291 b.WriteString("\n")
1292 if d.PolicyDiff != nil {
1293 b.WriteString(d.PolicyDiff.String())
1294 b.WriteString("\n")
1295 }
1296 return []byte(b.String())
1297}
1298
1299// WriteAll writes ComponentResultsDisplay to all specified output formats
1300func (d ComponentResultsDisplay) WriteAll(outputFormats []string, fs afero.Fs, cmd *cobra.Command) error {

Callers 2

toFormatMethod · 0.95
marshalVSAReportTextFunction · 0.80

Calls 1

StringMethod · 0.45

Tested by

no test coverage detected