File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -208,12 +208,13 @@ func getRootPaths(paths []string) []string {
208208 return rootPaths
209209}
210210
211+ // If verbose is defined it overwrites the defined format
212+ // Otherwise the actual format is used
211213func getPrintedFormat (format string , verbose string ) string {
212- fileFormat := format
213- if format != "" && verbose != "" {
214- fileFormat = verbose
214+ if verbose != "" {
215+ return verbose
215216 }
216- return fileFormat
217+ return format
217218}
218219
219220func printReport (format string , color bool , rootPaths []string , reportInfo * gosec.ReportInfo ) error {
@@ -384,7 +385,7 @@ func main() {
384385 reportInfo := gosec .NewReportInfo (issues , metrics , errors ).WithVersion (Version )
385386
386387 if * flagOutput == "" || * flagStdOut {
387- fileFormat := getPrintedFormat (* flagOutput , * flagVerbose )
388+ fileFormat := getPrintedFormat (* flagFormat , * flagVerbose )
388389 if err := printReport (fileFormat , * flagColor , rootPaths , reportInfo ); err != nil {
389390 logger .Fatal ((err ))
390391 }
You can’t perform that action at this time.
0 commit comments