Skip to content

Commit 2d9ac8a

Browse files
committed
Update error handling to pass basic linting standards
1 parent d201228 commit 2d9ac8a

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

cmd/helm-set-status/main.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package main
22

33
import (
44
"errors"
5+
"fmt"
56
"io"
67
"os"
78

@@ -20,7 +21,10 @@ func NewRootCmd(out io.Writer, args []string) *cobra.Command {
2021
SilenceUsage: true,
2122
Args: func(cmd *cobra.Command, args []string) error {
2223
if len(args) == 0 {
23-
cmd.Help()
24+
err := cmd.Help()
25+
if err != nil {
26+
fmt.Println("Unable to print help information")
27+
}
2428
os.Exit(1)
2529
} else if len(args) != 2 {
2630
return errors.New("release and status must be specified")
@@ -30,7 +34,10 @@ func NewRootCmd(out io.Writer, args []string) *cobra.Command {
3034
RunE: runSetStatus,
3135
}
3236
flags := cmd.PersistentFlags()
33-
flags.Parse(args)
37+
err := flags.Parse(args)
38+
if err != nil {
39+
fmt.Println("Failed to parse arguments!")
40+
}
3441
settings = new(EnvSettings)
3542
settings.AddFlags(flags)
3643

0 commit comments

Comments
 (0)