Skip to content

Commit

Permalink
Fixing linting errors and updating .getignore.
Browse files Browse the repository at this point in the history
Signed-off-by: Robert Sirchia <[email protected]>
  • Loading branch information
robertsirc committed Jul 25, 2024
1 parent d7883e3 commit 7007730
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ bin/
dist/
tmp/
releases/

.idea/
11 changes: 9 additions & 2 deletions cmd/mapkubeapis/map.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ func newMapCmd(out io.Writer, args []string) *cobra.Command {
SilenceUsage: true,
Args: func(cmd *cobra.Command, args []string) error {
if len(args) == 0 {
cmd.Help()
err := cmd.Help()
if err != nil {
return err
}
os.Exit(1)
} else if len(args) > 1 {
return errors.New("only one release name may be passed at a time")
Expand All @@ -62,7 +65,11 @@ func newMapCmd(out io.Writer, args []string) *cobra.Command {

flags := cmd.PersistentFlags()
flags.ParseErrorsWhitelist.UnknownFlags = true
flags.Parse(args)
err := flags.Parse(args)
if err != nil {
return nil
}

settings = new(EnvSettings)

// Get the default mapping file
Expand Down
5 changes: 4 additions & 1 deletion pkg/v3/connect.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ func GetActionConfig(namespace string, kubeConfig common.KubeConfig) (*action.Co
func debug(format string, v ...interface{}) {
if settings.Debug {
format = fmt.Sprintf("[debug] %s\n", format)
log.Output(2, fmt.Sprintf(format, v...))
err := log.Output(2, fmt.Sprintf(format, v...))
if err != nil {
return
}
}
}

0 comments on commit 7007730

Please sign in to comment.