verbose

package
v1.76.0 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2026 License: Apache-2.0 Imports: 4 Imported by: 4 modules, 8 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// NopPrinter is a no-op printer.
	//
	// This generally aligns with the --verbose flag not being set.
	NopPrinter = nopPrinter{}
)

Functions

This section is empty.

Types

type Printer

type Printer interface {
	// Enabled returns true if verbose mode is enabled.
	//
	// This is false if the Printer is a no-op printer.
	Enabled() bool
	// Printf prints a new verbose message.
	//
	// Leading and trailing newlines are not respected.
	//
	// Callers should not rely on the print calls being reliable, i.e. errors to
	// a backing Writer will be ignored.
	Printf(format string, args ...any)
	// contains filtered or unexported methods
}

Printer prints verbose messages.

func NewPrinter added in v1.32.0

func NewPrinter(writer io.Writer, prefix string) Printer

NewPrinter returns a new Printer using the given Writer.

The trimmed prefix is printed with a : before each line.

This generally aligns with the --verbose flag being set and writer being stderr.

func NewPrinterForFlagValue added in v1.32.0

func NewPrinterForFlagValue(writer io.Writer, prefix string, verboseValue bool) Printer

NewPrinterForFlagValue returns a new Printer for the given verboseValue flag value.

Jump to

Keyboard shortcuts

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