Skip to content

Commit

Permalink
fix: exit early on run --version
Browse files Browse the repository at this point in the history
  • Loading branch information
ldez committed Aug 5, 2022
1 parent 0a884a4 commit b746573
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/commands/root.go
Expand Up @@ -8,6 +8,7 @@ import (
"runtime/trace"
"strconv"

"github.com/golangci/golangci-lint/pkg/exitcodes"
"github.com/spf13/cobra"
"github.com/spf13/pflag"

Expand All @@ -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)
Expand Down

0 comments on commit b746573

Please sign in to comment.