mirror of
https://github.com/fluxcd/flux2.git
synced 2026-02-07 16:27:27 +00:00
misc: simplify row append
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
This commit is contained in:
parent
43c2359705
commit
3278a0782f
1 changed files with 2 additions and 4 deletions
|
|
@ -23,7 +23,7 @@ import (
|
|||
"github.com/olekukonko/tablewriter"
|
||||
)
|
||||
|
||||
// TablePrinter is a printer that prints Flux cmd outputs.
|
||||
// TablePrinter is a printer that prints Flux cmd outputs.
|
||||
func TablePrinter(header []string) PrinterFunc {
|
||||
return func(w io.Writer, args ...interface{}) error {
|
||||
var rows [][]string
|
||||
|
|
@ -35,9 +35,7 @@ func TablePrinter(header []string) PrinterFunc {
|
|||
if !ok {
|
||||
return fmt.Errorf("unsupported type %T", v)
|
||||
}
|
||||
for i := range s {
|
||||
rows = append(rows, s[i])
|
||||
}
|
||||
rows = append(rows, s...)
|
||||
}
|
||||
default:
|
||||
return fmt.Errorf("unsupported type %T", arg)
|
||||
|
|
|
|||
Loading…
Reference in a new issue