Skip to content

Commit b746573

Browse files
committed
fix: exit early on run --version
1 parent 0a884a4 commit b746573

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pkg/commands/root.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"runtime/trace"
99
"strconv"
1010

11+
"github.com/golangci/golangci-lint/pkg/exitcodes"
1112
"github.com/spf13/cobra"
1213
"github.com/spf13/pflag"
1314

@@ -18,7 +19,7 @@ import (
1819
func (e *Executor) persistentPreRun(_ *cobra.Command, _ []string) error {
1920
if e.cfg.Run.PrintVersion {
2021
_, _ = fmt.Fprintf(logutils.StdOut, "golangci-lint has version %s built from %s on %s\n", e.version, e.commit, e.date)
21-
return nil
22+
os.Exit(exitcodes.Success)
2223
}
2324

2425
runtime.GOMAXPROCS(e.cfg.Run.Concurrency)

0 commit comments

Comments
 (0)