From fdb8e2bbe9f1abca8d1630ab0176c092774500e6 Mon Sep 17 00:00:00 2001 From: Felipe Avelar Date: Wed, 26 May 2021 14:58:42 +0100 Subject: [PATCH] Corrected golangci-lint issue Signed-off-by: Felipe Avelar --- internal/console/scan.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/internal/console/scan.go b/internal/console/scan.go index 561e69efc8c..59b6b35bef5 100644 --- a/internal/console/scan.go +++ b/internal/console/scan.go @@ -291,9 +291,7 @@ func initScanFlags(scanCmd *cobra.Command) { outputPathShorthand, "", "directory path to store reports") - scanCmd.Flags().StringSliceVar(&reportFormats, - reportFormatsFlag, - []string{"json"}, + scanCmd.Flags().StringSliceVar(&reportFormats, reportFormatsFlag, []string{"json"}, "formats in which the results will be exported (all, json, sarif, html)", ) scanCmd.Flags().IntVar(&previewLines, @@ -623,7 +621,8 @@ func printOutput(outputPath, filename string, body interface{}, formats []string // gracefulShutdown catches signal interrupt and returns the appropriate exit code func gracefulShutdown() { c := make(chan os.Signal) - signal.Notify(c, os.Interrupt, syscall.SIGTERM) + // This line should not be lint, since golangci-lint has an issue about it (https://github.com/golang/go/issues/45043) + signal.Notify(c, os.Interrupt, syscall.SIGTERM) // nolint showErrors := consoleHelpers.ShowError("errors") interruptCode := constants.SignalInterruptCode go func(showErrors bool, interruptCode int) {