Skip to content

Commit 810b033

Browse files
committed
Log the bubbled up error instead of printing it
Signed-off-by: Richard Wall <[email protected]>
1 parent fff111c commit 810b033

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

cmd/root.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@ import (
55
"os"
66
"strings"
77

8-
"github.com/jetstack/preflight/pkg/logs"
98
"github.com/spf13/cobra"
109
"github.com/spf13/pflag"
10+
11+
"github.com/jetstack/preflight/pkg/logs"
1112
)
1213

1314
// rootCmd represents the base command when called without any subcommands
@@ -35,8 +36,7 @@ func Execute() {
3536
logs.AddFlags(rootCmd.PersistentFlags())
3637

3738
if err := rootCmd.Execute(); err != nil {
38-
fmt.Println(err)
39-
os.Exit(1)
39+
logs.Log.Fatal(err)
4040
}
4141
}
4242

0 commit comments

Comments
 (0)