Documentation
¶
Overview ¶
Package status provides basic facility to print status line to the terminal.
Typical usage:
line := new(status.Line) defer line.Done() for i := 0; i < total; i++ { line.Printf("step %d out of %d", i, total) ... }
This package outputs VT100 escape sequences, so its output may break if your terminal does not support them.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Line ¶
type Line struct {
// contains filtered or unexported fields
}
Line can be used to print a single status line, overwriting it on each Print/Printf call. Finish with Done call to move cursor to the new line.
By default Line writes to os.Stdout, use SetOutput method to override.
If Line's output is not connected to a terminal (for example, if program's output is redirected to a file), Print/Printf calls do nothing.
func (*Line) Print ¶
Print works like fmt.Print. Because Line is expected to write over a single line, including any newlines will break output.