termout

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package termout prints user-facing CLI output. Symbols and emojis are kept on an interactive terminal and replaced by plain ASCII markers (or dropped when purely decorative) when stdout is a pipe or NO_COLOR / CI is set, so CI consoles and log files stay readable.

Index

Constants

This section is empty.

Variables

View Source
var Plain = func() bool {
	if os.Getenv("NO_COLOR") != "" || os.Getenv("CI") != "" {
		return true
	}
	info, err := os.Stdout.Stat()
	return err != nil || info.Mode()&os.ModeCharDevice == 0
}

Plain reports whether output must avoid symbols.

Functions

func Fprintf

func Fprintf(w io.Writer, format string, args ...interface{})

Fprintf writes a formatted line to w, adapting the format string.

func Printf

func Printf(format string, args ...interface{})

Printf writes a formatted line to stdout.

func Println

func Println(s string)

Println writes s and a newline to stdout.

func Text

func Text(s string) string

Text adapts s to the current output.

Types

This section is empty.

Jump to

Keyboard shortcuts

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