diff --git a/writer/table.go b/writer/table.go index 630800d..dbb77a0 100644 --- a/writer/table.go +++ b/writer/table.go @@ -20,9 +20,12 @@ func NewTableWriter(output io.Writer)*TableWriter { func (c *TableWriter) Print(deals hetzner.Deals) { fmt.Fprintf(c.tabWriter,"Got %d offers. Filtered offers: %d\n", deals.ResultStats.OriginalCount, deals.ResultStats.FilteredCount) - fmt.Fprintf(c.tabWriter, "%s\n", deals.Servers[0].Header()) - for _, server := range deals.Servers { - fmt.Fprintf(c.tabWriter, "%s\n", server.ToString()) + if deals.ResultStats.FilteredCount != { + fmt.Fprintf(c.tabWriter, "%s\n", deals.Servers[0].Header()) + for _, server := range deals.Servers { + fmt.Fprintf(c.tabWriter, "%s\n", server.ToString()) + } + c.tabWriter.Flush() } - c.tabWriter.Flush() + }