ansi

package
v3.17.2 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var IsColorDisabled = DisableColors()

Functions

func Color added in v3.14.1

func Color(s string, style string) string

Color is a wrapper around ansi.Color that respects the NO_COLOR environment variable

func ColorForWriter added in v3.16.12

func ColorForWriter(w io.Writer, s, style string) string

ColorForWriter colors s only when w is connected to a terminal.

func DisableColors added in v3.14.1

func DisableColors() bool

func Strip

func Strip(line []byte) []byte

func WriterSupportsColor added in v3.16.12

func WriterSupportsColor(w io.Writer) bool

WriterSupportsColor reports whether w is connected to a terminal that can display ANSI colors.

Types

This section is empty.

Jump to

Keyboard shortcuts

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