pretty

package
v0.0.0-...-aa656b0 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

ANSI escape codes

Index

Constants

View Source
const EraseLine string = "\x1b[2K"

EraseLine always returns the erase line code as it's used for progress indicators

Variables

This section is empty.

Functions

func AllowDynamic

func AllowDynamic(f *os.File) bool

Allow backspacing and replacing output for e.g. progress indicator?

func DefaultColor

func DefaultColor() string

DefaultColor returns the default color ANSI code if colors are enabled, empty string otherwise

func Dim

func Dim() string

Dim returns the dim ANSI code if colors are enabled, empty string otherwise

func GetColorEnabled

func GetColorEnabled() bool

GetColorEnabled returns whether ANSI color codes are currently enabled

func Green

func Green() string

Green returns the green ANSI code if colors are enabled, empty string otherwise

func Invert

func Invert() string

Invert returns the invert ANSI code if colors are enabled, empty string otherwise

func Red

func Red() string

Red returns the red ANSI code if colors are enabled, empty string otherwise

func Reset

func Reset() string

Reset returns the reset ANSI code if colors are enabled, empty string otherwise

func SetColorEnabled

func SetColorEnabled(enabled bool)

SetColorEnabled controls whether ANSI color codes are output

Types

This section is empty.

Jump to

Keyboard shortcuts

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