text

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2025 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ColumnCollector

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

A ColumnCollector may be used to collect lines of text with variable numbers and widths of columns, which can then be written out with aligned columns. The zero value is ready to use.

func (*ColumnCollector) AddField

func (cc *ColumnCollector) AddField(str string) error

AddField will add a field (column in a line) to the current line being collected.

func (*ColumnCollector) CompleteLine

func (cc *ColumnCollector) CompleteLine() error

CompleteLine marks the end of the current line being collected.

func (*ColumnCollector) WriteLeftAligned

func (cc *ColumnCollector) WriteLeftAligned(w io.Writer) error

WriteLeftAligned will write all the collected lines to the specified writer, aligning the columns on the left side. All collected data are cleared on success.

Jump to

Keyboard shortcuts

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