output

package
v0.21.3 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options added in v0.11.0

type Options struct {
	Color   bool
	Steps   bool
	Quiet   bool
	Verbose bool
}

Options controls output behavior.

type Output

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

Output handles colored terminal output. The caller decides whether to enable color (by checking NO_COLOR, TTY status, etc.) and passes the decision in.

func New

func New(w io.Writer, useColor bool) *Output

New creates an Output that writes to w. color controls whether ANSI codes are emitted.

func NewWithOptions added in v0.11.0

func NewWithOptions(w io.Writer, opts Options) *Output

NewWithOptions creates an Output with explicit behavior.

func (*Output) Error

func (o *Output) Error(msg string)

Error writes an error message in red.

func (*Output) Info

func (o *Output) Info(msg string)

Info writes an informational message in cyan.

func (*Output) Step

func (o *Output) Step(msg string)

Step writes a sub-step message indented under the main arrow.

func (*Output) StepPrefix

func (o *Output) StepPrefix() string

StepPrefix returns the colored prefix string for use in progress lines that need \r overwriting.

func (*Output) Success

func (o *Output) Success(msg string)

Success writes a success message in green.

func (*Output) Verbose added in v0.16.3

func (o *Output) Verbose() bool

Verbose reports whether verbose output is enabled.

func (*Output) Verbosef added in v0.16.3

func (o *Output) Verbosef(format string, args ...any)

Verbosef writes a diagnostic line when verbose mode is on. Suppressed by quiet mode. Caller controls formatting; no prefix is added.

func (*Output) Warn

func (o *Output) Warn(msg string)

Warn writes a warning message in yellow.

Jump to

Keyboard shortcuts

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