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

Function ContainsOutputFormat

internal/validate/report.go:96–104  ·  view source on GitHub ↗

ContainsOutputFormat checks if the specified output format is in the output formats list. It handles formats that may include file paths (e.g., "attestation=/path/to/file").

(outputFormats []string, format string)

Source from the content-addressed store, hash-verified

94// ContainsOutputFormat checks if the specified output format is in the output formats list.
95// It handles formats that may include file paths (e.g., "attestation=/path/to/file").
96func ContainsOutputFormat(outputFormats []string, format string) bool {
97 for _, item := range outputFormats {
98 parts := strings.Split(item, "=")
99 if parts[0] == format {
100 return true
101 }
102 }
103 return false
104}
105
106// CollectComponentResults processes a slice of results, accumulating errors and collecting successful components.
107// It returns the collected components (sorted by ContainerImage), policy inputs, and any aggregated errors.

Callers 3

TestContainsOutputFormatFunction · 0.85
PopulateResultFromOutputFunction · 0.85

Calls

no outgoing calls

Tested by 2

TestContainsOutputFormatFunction · 0.68