mirror of
https://github.com/securego/gosec.git
synced 2024-11-05 19:45:51 +00:00
parent
e3dffd6450
commit
3ff0a2cc36
1 changed files with 6 additions and 5 deletions
|
@ -208,12 +208,13 @@ func getRootPaths(paths []string) []string {
|
|||
return rootPaths
|
||||
}
|
||||
|
||||
// If verbose is defined it overwrites the defined format
|
||||
// Otherwise the actual format is used
|
||||
func getPrintedFormat(format string, verbose string) string {
|
||||
fileFormat := format
|
||||
if format != "" && verbose != "" {
|
||||
fileFormat = verbose
|
||||
if verbose != "" {
|
||||
return verbose
|
||||
}
|
||||
return fileFormat
|
||||
return format
|
||||
}
|
||||
|
||||
func printReport(format string, color bool, rootPaths []string, reportInfo *gosec.ReportInfo) error {
|
||||
|
@ -384,7 +385,7 @@ func main() {
|
|||
reportInfo := gosec.NewReportInfo(issues, metrics, errors).WithVersion(Version)
|
||||
|
||||
if *flagOutput == "" || *flagStdOut {
|
||||
fileFormat := getPrintedFormat(*flagOutput, *flagVerbose)
|
||||
fileFormat := getPrintedFormat(*flagFormat, *flagVerbose)
|
||||
if err := printReport(fileFormat, *flagColor, rootPaths, reportInfo); err != nil {
|
||||
logger.Fatal((err))
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue