PrintFileAnnotationSet prints the file annotations separated by newlines.
(writer io.Writer, fileAnnotationSet FileAnnotationSet, formatString string)
| 219 | |
| 220 | // PrintFileAnnotationSet prints the file annotations separated by newlines. |
| 221 | func PrintFileAnnotationSet(writer io.Writer, fileAnnotationSet FileAnnotationSet, formatString string) error { |
| 222 | format, err := ParseFormat(formatString) |
| 223 | if err != nil { |
| 224 | return err |
| 225 | } |
| 226 | |
| 227 | switch format { |
| 228 | case FormatText: |
| 229 | return printAsText(writer, fileAnnotationSet.FileAnnotations()) |
| 230 | case FormatJSON: |
| 231 | return printAsJSON(writer, fileAnnotationSet.FileAnnotations()) |
| 232 | case FormatMSVS: |
| 233 | return printAsMSVS(writer, fileAnnotationSet.FileAnnotations()) |
| 234 | case FormatJUnit: |
| 235 | return printAsJUnit(writer, fileAnnotationSet.FileAnnotations()) |
| 236 | case FormatGithubActions: |
| 237 | return printAsGithubActions(writer, fileAnnotationSet.FileAnnotations()) |
| 238 | case FormatGitLabCodeQuality: |
| 239 | return printAsGitLabCodeQuality(writer, fileAnnotationSet.FileAnnotations()) |
| 240 | default: |
| 241 | return fmt.Errorf("unknown FileAnnotation Format: %v", format) |
| 242 | } |
| 243 | } |
searching dependent graphs…