PrintPrettySection prints a tabbed section on the writer parameter
(out io.Writer, printer func(writer io.Writer), headers ...string)
| 25 | |
| 26 | // PrintPrettySection prints a tabbed section on the writer parameter |
| 27 | func PrintPrettySection(out io.Writer, printer func(writer io.Writer), headers ...string) error { |
| 28 | w := tabwriter.NewWriter(out, 20, 1, 3, ' ', 0) |
| 29 | _, _ = fmt.Fprintln(w, strings.Join(headers, "\t")) |
| 30 | printer(w) |
| 31 | return w.Flush() |
| 32 | } |