Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( RegexAnsiFormat = regexp.MustCompile(`\x1b\[[0-9;]+m`) RegexAnsiReset = regexp.MustCompile(`\x1b\[[0]?m`) )
View Source
var ( ClearFormatRules = []FormatRule{ func(m string) string { return regexp.MustCompile(`\x1b\[[0-9;]*m`).ReplaceAllString(m, "") }, func(m string) string { return regexp.MustCompile(`\t`).ReplaceAllString(m, " ") }, } FormatRules = []FormatRule{ func(m string) string { return regexp.MustCompile(`\t`).ReplaceAllString(m, " ") }, } ExtendedFormatRules = []FormatRule{ func(m string) string { return regexp.MustCompile(`\\033`).ReplaceAllString(m, "\x1b") }, func(m string) string { m, _ = strconv.Unquote("\"" + m + "\""); return m }, } )
Functions ¶
func GetRandomFrom ¶
func GetRandomFrom[T any](collection []T) T
func GetTermSize ¶
Types ¶
type FormatRule ¶
Click to show internal directories.
Click to hide internal directories.