Skip to content

Commit

Permalink
fix lint error
Browse files Browse the repository at this point in the history
  • Loading branch information
jackton1 committed Jul 28, 2022
1 parent b41f1af commit 9f44190
Showing 1 changed file with 9 additions and 14 deletions.
23 changes: 9 additions & 14 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ package cmd

import (
"bytes"
"errors"
"fmt"
"github.com/olekukonko/tablewriter"
"github.com/spf13/cobra"
Expand Down Expand Up @@ -136,12 +135,10 @@ func (a *Action) renderOutput() error {
case "Description":
row = append(row, wordWrap(a.Inputs[key].Description, maxWords))
default:
return errors.New(
fmt.Sprintf(
"unknown input column: '%s'. Please specify any of the following columns: %s",
col,
strings.Join(defaultInputColumns, ", "),
),
return fmt.Errorf(
"unknown input column: '%s'. Please specify any of the following columns: %s",
col,
strings.Join(defaultInputColumns, ", "),
)
}
}
Expand Down Expand Up @@ -198,12 +195,10 @@ func (a *Action) renderOutput() error {
case "Description":
row = append(row, wordWrap(a.Outputs[key].Description, maxWords))
default:
return errors.New(
fmt.Sprintf(
"unknown output column: '%s'. Please specify any of the following columns: %s",
col,
strings.Join(defaultOutputColumns, ", "),
),
return fmt.Errorf(
"unknown output column: '%s'. Please specify any of the following columns: %s",
col,
strings.Join(defaultOutputColumns, ", "),
)
}
}
Expand Down Expand Up @@ -282,7 +277,7 @@ var rootCmd = &cobra.Command{

func RootCmdRunE(cmd *cobra.Command, args []string) error {
if len(args) > 0 {
return errors.New("requires no positional arguments")
return fmt.Errorf("requires no positional arguments: %d given", len(args))
}

var action Action
Expand Down

0 comments on commit 9f44190

Please sign in to comment.