MCPcopy
hub / github.com/docker/compose / makeConsole

Function makeConsole

pkg/compose/build_bake.go:444–449  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.
444func makeConsole(out io.Writer) io.Writer {
445 if s, ok := out.(*streams.Out); ok {
446 return &_console{s}
447 }
448 return out
449}
450
451var _ console.File = &_console{}
452

Callers 1

doBuildBakeMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected