chore: removes bar on normal analyze events

Signed-off-by: AlexsJones <alexsimonjones@gmail.com>
This commit is contained in:
AlexsJones 2023-04-01 16:18:40 +01:00
parent f337f6b447
commit 96d0d754ea

View File

@ -83,16 +83,14 @@ var AnalyzeCmd = &cobra.Command{
os.Exit(1) os.Exit(1)
} }
var bar *progressbar.ProgressBar if len(*analysisResults) == 0 {
if len(*analysisResults) > 0 {
bar = progressbar.Default(int64(len(*analysisResults)))
} else {
color.Green("{ \"status\": \"OK\" }") color.Green("{ \"status\": \"OK\" }")
os.Exit(0) os.Exit(0)
} }
var bar = progressbar.Default(int64(len(*analysisResults)))
// This variable is used to store the results that will be printed if !explain {
// It's necessary because the heap memory is lost when the function returns bar.Clear()
}
var printOutput []analyzer.Analysis var printOutput []analyzer.Analysis
for _, analysis := range *analysisResults { for _, analysis := range *analysisResults {