diff --git a/pkg/commands/root.go b/pkg/commands/root.go index 8ab119608dc7..7d6af460dec9 100644 --- a/pkg/commands/root.go +++ b/pkg/commands/root.go @@ -8,6 +8,7 @@ import ( "runtime/trace" "strconv" + "github.com/golangci/golangci-lint/pkg/exitcodes" "github.com/spf13/cobra" "github.com/spf13/pflag" @@ -18,7 +19,7 @@ import ( func (e *Executor) persistentPreRun(_ *cobra.Command, _ []string) error { if e.cfg.Run.PrintVersion { _, _ = fmt.Fprintf(logutils.StdOut, "golangci-lint has version %s built from %s on %s\n", e.version, e.commit, e.date) - return nil + os.Exit(exitcodes.Success) } runtime.GOMAXPROCS(e.cfg.Run.Concurrency)