From 3278a0782f7dafaf229390a78888c7488a2caf90 Mon Sep 17 00:00:00 2001 From: Hidde Beydals Date: Fri, 13 Oct 2023 10:12:36 +0200 Subject: [PATCH] misc: simplify row append Signed-off-by: Hidde Beydals --- pkg/printers/table_printer.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pkg/printers/table_printer.go b/pkg/printers/table_printer.go index 716166ab..7f4f331e 100644 --- a/pkg/printers/table_printer.go +++ b/pkg/printers/table_printer.go @@ -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)