util

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: May 23, 2022 License: MPL-2.0 Imports: 7 Imported by: 13

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CaptureOutput

func CaptureOutput(f func()) string

CaptureOutput captures any writing to the STDOUT/STDERR in the passed function and returns a string

func DoIf

func DoIf(condition bool, f func())

DoIf runs a passed function if the condition is true

func IfErrorLog

func IfErrorLog(err error)

IfErrorLog Checks to see if an error exists, and if so simply writes it to the log.

func IsErrorBool

func IsErrorBool(err error) (b bool)

IsErrorBool Checks to see if an error exists, and if so returns true after writing the error to the log

func PrintErr

func PrintErr(err error)

PrintErr Prints an error message with a yellow indicator to STDOUT

func PrintErrf added in v0.2.0

func PrintErrf(f string, err error)

PrintErrf Prints an error message with a yellow indicator to STDOUT when passed a format

func PrintInfo

func PrintInfo(a ...any)

PrintInfo Prints an informational message with a blue indicator to STDOUT

func PrintInfof added in v0.2.0

func PrintInfof(f string, a ...any)

PrintInfof Prints an informational message with a blue indicator to STDOUT when passed a format

func PrintSuccess

func PrintSuccess(a ...any)

PrintSuccess Prints a success message with a green indicator to STDOUT

func PrintSuccessf added in v0.2.0

func PrintSuccessf(f string, a ...any)

PrintSuccessf Prints a success message with a green indicator to STDOUT when passed a format

func PrintTabbed

func PrintTabbed(a ...any)

PrintTabbed Prints a message prepended with a tab to STDOUT

func PrintTabbedf added in v0.2.0

func PrintTabbedf(f string, a ...any)

PrintTabbedf Prints a message prepended with a tab to STDOUT when passed a format

func PrintWarning

func PrintWarning(a ...any)

PrintWarning Prints a warning message with a yellow indicator to STDOUT

func PrintWarningf added in v0.2.0

func PrintWarningf(f string, a ...any)

PrintWarningf Prints a warning message with a yellow indicator to STDOUT when passed a format

Types

This section is empty.

Jump to

Keyboard shortcuts

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