(items []templateListItem)
| 77 | } |
| 78 | |
| 79 | func outputTemplatesTable(items []templateListItem) error { |
| 80 | if len(items) == 0 { |
| 81 | fmt.Println("No templates found") |
| 82 | return nil |
| 83 | } |
| 84 | |
| 85 | w := tabwriter.NewWriter(os.Stdout, 0, 0, 2, ' ', 0) |
| 86 | fmt.Fprintln(w, "NAME\tDESCRIPTION\tSOURCE") |
| 87 | fmt.Fprintln(w, "----\t-----------\t------") |
| 88 | for _, item := range items { |
| 89 | fmt.Fprintf(w, "%s\t%s\t%s\n", item.Name, item.Description, item.Source) |
| 90 | } |
| 91 | return w.Flush() |
| 92 | } |
no test coverage detected