colors

package
v2.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package colors is an indirection to handle colorized output.

This package allows the builder to override the indirection with an alternative implementation of colorized printers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Enable

func Enable(enabler func() []Option)

Enable registers colorized options for pretty-printing the output of assertions.

The provided enabler defers the initialization, so we may retrieve flags after command line parsing or other initialization tasks.

This is not intended for concurrent use.

Types

type Option

type Option = colorstub.Option

Option is a colorization option.

func WithDark

func WithDark() Option

WithDark sets the [ThemeDark] color theme.

func WithEnable

func WithEnable(enabled bool) Option

WithEnable enables colorization.

func WithLight

func WithLight() Option

WithLight sets the [ThemeLight] color theme.

func WithSanitizedTheme

func WithSanitizedTheme(theme string) Option

WithSanitizedTheme sets a colorization theme from a string.

func WithTheme

func WithTheme(theme Theme) Option

WithTheme sets a colorization theme.

type Theme

type Theme = colorstub.Theme

Theme is a colorization theme for testify output.

Jump to

Keyboard shortcuts

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