makeConsole wraps the provided writer to match [containerd.File] interface if it is of type *streams.Out. buildkit's NewDisplay doesn't actually require a [io.Reader], it only uses the [containerd.Console] type to benefits from ANSI capabilities, but only does writes.
(out io.Writer)
| 442 | // buildkit's NewDisplay doesn't actually require a [io.Reader], it only uses the [containerd.Console] type to |
| 443 | // benefits from ANSI capabilities, but only does writes. |
| 444 | func makeConsole(out io.Writer) io.Writer { |
| 445 | if s, ok := out.(*streams.Out); ok { |
| 446 | return &_console{s} |
| 447 | } |
| 448 | return out |
| 449 | } |
| 450 | |
| 451 | var _ console.File = &_console{} |
| 452 |