Documentation ¶
Overview ¶
Package colwriter provides a write filter that formats input lines in multiple columns.
The package is a straightforward translation from /src/cmd/draw/mc.c in Plan 9 from User Space.
Index ¶
Constants ¶
const ( // Print each input line ending in a colon ':' separately. BreakOnColon uint = 1 << iota )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Writer ¶
type Writer struct {
// contains filtered or unexported fields
}
A Writer is a filter that arranges input lines in as many columns as will fit in its width. Tab '\t' chars in the input are translated to sequences of spaces ending at multiples of 4 positions.
If BreakOnColon is set, each input line ending in a colon ':' is written separately.
The Writer assumes that all Unicode code points have the same width; this may not be true in some fonts.
func NewWriter ¶
NewWriter allocates and initializes a new Writer writing to w. Parameter width controls the total number of characters on each line across all columns.