func ParseSourceFormat()

in pkg/types/format.go [49:60]


func ParseSourceFormat(s string) (SourceFormat, error) {
	switch s {
	case SourceFormatGrypeJSONName:
		return SourceFormatGrypeJSON, nil
	case SourceFormatTrivyJSONName:
		return SourceFormatTrivyJSON, nil
	case SourceFormatSnykJSONName:
		return SourceFormatSnykJSON, nil
	default:
		return SourceFormatUnknown, fmt.Errorf("unknown format: %s", s)
	}
}