(r io.Reader, w io.Writer)
| 19 | } |
| 20 | |
| 21 | func (a AutoColorPrinter) Print(r io.Reader, w io.Writer) error { |
| 22 | if isatty.IsTerminal(uintptr(syscall.Stdout)) { |
| 23 | return ColorPrinter{a.ColorPalettes}.Print(r, w) |
| 24 | } else { |
| 25 | return PlainTextPrinter{}.Print(r, w) |
| 26 | } |
| 27 | } |
| 28 | |
| 29 | type ColorPrinter struct { |
| 30 | ColorPalettes ColorPalettes |