utils

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Colors = struct {
	reset   string
	Red     string
	Green   string
	Yellow  string
	Orange  string
	Blue    string
	Magenta string
	Cyan    string
	Gray    string
	White   string
}{

	Red:     "\033[31m",
	Green:   "\033[32m",
	Yellow:  "\033[33m",
	Orange:  "\033[38;5;208m",
	Blue:    "\033[34m",
	Magenta: "\033[35m",
	Cyan:    "\033[36m",
	Gray:    "\033[37m",
	White:   "\033[97m",
	// contains filtered or unexported fields
}

Functions

func AvgDuration

func AvgDuration(durations ...time.Duration) time.Duration

func Colored

func Colored(color string, a ...any) string

func Contains

func Contains[T comparable](slice []T, item T) bool

func Flatten

func Flatten[T any](nested [][]T) []T

func MaxDuration

func MaxDuration(durations ...time.Duration) time.Duration

func MinDuration

func MinDuration(durations ...time.Duration) time.Duration

func PrintAndExit

func PrintAndExit(message string)

func PrintErr

func PrintErr(err error)

func PrintErrAndExit

func PrintErrAndExit(err error)

func PrintfC

func PrintfC(color string, format string, a ...any)

func PrintlnC

func PrintlnC(color string, a ...any)

Types

This section is empty.

Jump to

Keyboard shortcuts

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