wrapped

package
v0.16.6 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// LineLength is the maximum length allowed of a printed line of text. This is
	// the primary control for this package. It defaults to the greater of the
	// current terminal width (detected at init time) and MaxLineLength.
	LineLength = initialLineLength

	// MaxLineLength sets the upper bound for how long a line can be. This is a
	// secondary control that adjusts how LineLength is calculated. It defaults to
	// 120 (for readability).
	MaxLineLength = 120
)

Functions

func Fatal

func Fatal(msg string)

Fatal wraps the given message using LineLength and prints it to stderr with a trailing newline, then exits with a non-zero status code.

func Println

func Println(msg string)

Println wraps the given message using LineLength and prints it to stdout with a trailing newline.

func Repeat

func Repeat(s string) string

Repeat repeats the given message string until the LineLength is reached, such that the returned string is exactly LineLength long. If the given string is already longer than LineLength, it is truncated to LineLength.

func Sprint added in v0.16.0

func Sprint(msg string) string

Sprint wraps the given message using LineLength and returns it as a string.

Types

This section is empty.

Jump to

Keyboard shortcuts

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