Documentation
¶
Overview ¶
Package ui contains small terminal-formatting helpers for the compiler CLI.
Index ¶
- func Clock() string
- func IsTerminal(f *os.File) bool
- func NewLineWriter(dst io.Writer, fn func(line string) (string, bool)) io.WriteCloser
- type Printer
- func (p *Printer) Bold(s string) string
- func (p *Printer) Cyan(s string) string
- func (p *Printer) Dim(s string) string
- func (p *Printer) Enabled() bool
- func (p *Printer) Green(s string) string
- func (p *Printer) Magenta(s string) string
- func (p *Printer) Red(s string) string
- func (p *Printer) Yellow(s string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsTerminal ¶
IsTerminal reports whether f is a real terminal. A char-device stat check is not enough: /dev/null is a character device, and treating it as a TTY makes interactive prompts block forever in cron/CI environments.
func NewLineWriter ¶
NewLineWriter returns a writer that buffers bytes into lines, applies fn to each complete line, and writes accepted lines to dst.
Types ¶
type Printer ¶
type Printer struct {
// contains filtered or unexported fields
}
Printer applies ANSI styling when its stream supports color.
func New ¶
New returns a printer for f. Styling is enabled only for terminal files when NO_COLOR is unset and TERM is not "dumb".
Click to show internal directories.
Click to hide internal directories.