(buf io.Writer, namespaces []*observerpb.Namespace)
| 78 | } |
| 79 | |
| 80 | func namespaceTableOutput(buf io.Writer, namespaces []*observerpb.Namespace) error { |
| 81 | tw := tabwriter.NewWriter(buf, 2, 0, 3, ' ', 0) |
| 82 | // header |
| 83 | fmt.Fprint(tw, "NAMESPACE") |
| 84 | if listOpts.output == "wide" { |
| 85 | fmt.Fprint(tw, "\tCLUSTER") |
| 86 | } |
| 87 | fmt.Fprintln(tw) |
| 88 | |
| 89 | // contents |
| 90 | for _, ns := range namespaces { |
| 91 | fmt.Fprint(tw, ns.GetNamespace()) |
| 92 | if listOpts.output == "wide" && ns.GetCluster() != "" { |
| 93 | fmt.Fprint(tw, "\t", ns.GetCluster()) |
| 94 | } |
| 95 | fmt.Fprintln(tw) |
| 96 | } |
| 97 | return tw.Flush() |
| 98 | } |
searching dependent graphs…