Skip to content

Commit 64708b8

Browse files
committed
feat: simplify switch
1 parent 8963347 commit 64708b8

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

pkg/printers/printer.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ func (c *Printer) createPrinter(format string, w io.Writer) (issuePrinter, error
115115
switch format {
116116
case config.OutFormatJSON:
117117
p = NewJSON(c.reportData, w)
118-
case config.OutFormatColoredLineNumber, config.OutFormatLineNumber:
118+
case config.OutFormatLineNumber, config.OutFormatColoredLineNumber:
119119
p = NewText(c.cfg.PrintIssuedLine,
120120
format == config.OutFormatColoredLineNumber, c.cfg.PrintLinterName,
121121
c.log.Child(logutils.DebugKeyTextPrinter), w)
@@ -129,10 +129,8 @@ func (c *Printer) createPrinter(format string, w io.Writer) (issuePrinter, error
129129
p = NewCodeClimate(w)
130130
case config.OutFormatHTML:
131131
p = NewHTML(w)
132-
case config.OutFormatJunitXML:
133-
p = NewJunitXML(false, w)
134-
case config.OutFormatJunitXMLExtended:
135-
p = NewJunitXML(true, w)
132+
case config.OutFormatJunitXML, config.OutFormatJunitXMLExtended:
133+
p = NewJunitXML(format == config.OutFormatJunitXMLExtended, w)
136134
case config.OutFormatGithubActions:
137135
p = NewGitHubAction(w)
138136
case config.OutFormatTeamCity:

0 commit comments

Comments
 (0)