formatter

package
v2.22.0 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: MIT Imports: 6 Imported by: 72

Documentation

Index

Constants

View Source
const COLS = 80

Variables

View Source
var ColorableStdErr = newColorable(os.Stderr)
View Source
var ColorableStdOut = newColorable(os.Stdout)

ColorableStdOut and ColorableStdErr enable color output support on Windows

View Source
var SingletonFormatter = New(ColorModeTerminal)

Functions

func F

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

func Fi

func Fi(indentation uint, format string, args ...interface{}) string

func Fiw

func Fiw(indentation uint, maxWidth uint, format string, args ...interface{}) string

Types

type ColorMode

type ColorMode uint8
const (
	ColorModeNone ColorMode = iota
	ColorModeTerminal
	ColorModePassthrough
)

type Formatter

type Formatter struct {
	ColorMode ColorMode
	// contains filtered or unexported fields
}

func New

func New(colorMode ColorMode) Formatter

func NewWithNoColorBool

func NewWithNoColorBool(noColor bool) Formatter

func (Formatter) CycleJoin

func (f Formatter) CycleJoin(elements []string, joiner string, cycle []string) string

func (Formatter) F

func (f Formatter) F(format string, args ...interface{}) string

func (Formatter) Fi

func (f Formatter) Fi(indentation uint, format string, args ...interface{}) string

func (Formatter) Fiw

func (f Formatter) Fiw(indentation uint, maxWidth uint, format string, args ...interface{}) string

Jump to

Keyboard shortcuts

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