NewPrinter creates a new object printer.
(client *APIClient, cmd *cobra.Command, colors *yaml.Colors)
| 43 | |
| 44 | // NewPrinter creates a new object printer. |
| 45 | func NewPrinter(client *APIClient, cmd *cobra.Command, colors *yaml.Colors) (*Printer, error) { |
| 46 | return &Printer{client: client, cmd: cmd, colors: colors}, nil |
| 47 | } |
| 48 | |
| 49 | // Print prints the provided data to stdout. |
| 50 | func (p *Printer) Print(data interface{}) error { |