output

package
v0.19.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 22, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package output provides context-aware output for wt. Stdout is used for primary data output (tables, paths, JSON). Stderr (via log package) is used for diagnostics.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithPrinter

func WithPrinter(ctx context.Context, w io.Writer) context.Context

WithPrinter attaches a Printer to the context.

Types

type Printer

type Printer struct {
	// contains filtered or unexported fields
}

Printer writes primary output (data, tables, paths, JSON) to stdout.

func FromContext

func FromContext(ctx context.Context) *Printer

FromContext retrieves the Printer from context. Returns a Printer writing to os.Stdout if none is attached.

func (*Printer) Print

func (p *Printer) Print(a ...any)

Print writes output without a newline.

func (*Printer) Printf

func (p *Printer) Printf(format string, a ...any)

Printf writes formatted output.

func (*Printer) Println

func (p *Printer) Println(a ...any)

Println writes a line of output.

func (*Printer) Writer

func (p *Printer) Writer() io.Writer

Writer returns the underlying writer.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL