Skip to content

Commit 90c78f8

Browse files
committed
fix: check fmt.Fprintln return values in table printer
Fixes golangci-lint errcheck violations.
1 parent 6abaea2 commit 90c78f8

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

internal/output/table.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ func (p *TablePrinter) Print(data any, columns []Column) error {
2525
for i, col := range columns {
2626
headers[i] = col.Header
2727
}
28-
fmt.Fprintln(tw, strings.Join(headers, "\t"))
28+
if _, err := fmt.Fprintln(tw, strings.Join(headers, "\t")); err != nil {
29+
return err
30+
}
2931

3032
// Rows
3133
for _, item := range items {
@@ -37,7 +39,9 @@ func (p *TablePrinter) Print(data any, columns []Column) error {
3739
}
3840
vals[i] = v
3941
}
40-
fmt.Fprintln(tw, strings.Join(vals, "\t"))
42+
if _, err := fmt.Fprintln(tw, strings.Join(vals, "\t")); err != nil {
43+
return err
44+
}
4145
}
4246

4347
return tw.Flush()

0 commit comments

Comments
 (0)