utils

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2023 License: MIT Imports: 11 Imported by: 1

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Excuse

func Excuse() string

Excuse for something went wrong

func ExecuteCliCommand

func ExecuteCliCommand(cliCommand *exec.Cmd, silent bool) (err error)

ExecuteCliCommand - wrapper : runs a bash command, output is stdout

Example
cliCommand := exec.Command("echo", "hello", "world")
_ = ExecuteCliCommand(cliCommand, false)
Output:

hello world

func FileExists

func FileExists(name string) bool

FileExists - reports whether the named file or directory exists.

func GetCaller

func GetCaller() (string, string)

GetCaller - get the name of the function which called me and fileline number

func GetDateTimestamp

func GetDateTimestamp() string

GetDateTimestamp - returns nicely formated timestamp

func PrintDebug

func PrintDebug(debug string)

PrintDebug - prints nicely formated debug message

func PrintError

func PrintError(error string)

PrintError - prints nicely formated error message

func PrintFatal

func PrintFatal(error string)

PrintFatal - prints nicely formated fatal message

func PrintInformation

func PrintInformation(info string)

PrintInformation - prints nicely formated info message

func PrintMessage

func PrintMessage(message string)

PrintMessage - prints nicely formated message

Example
PrintMessage("test")
Output:

💬 test

func PrintSubTitle

func PrintSubTitle(subtitle string)

PrintSubTitle - prints nicely formated subtitle

Example
PrintSubTitle("test")
Output:

test
░░░░

func PrintSuccess

func PrintSuccess(success string)

PrintSuccess - prints nicely formated success info

func PrintTitle

func PrintTitle(title string)

PrintTitle - prints nicely formated title

Example
PrintTitle("test")
Output:

░░░░░░░░
░ test ░
░░░░░░░░

func PrintType added in v0.3.0

func PrintType(name string, obj interface{})

PrintType - prints the type of a interface

func PrintWarning

func PrintWarning(warning string)

PrintWarning - prints nicely formated warn message

func ReadLine

func ReadLine(msg string) (string, error)

ReadLine - prints nicely formated readline input

Types

This section is empty.

Jump to

Keyboard shortcuts

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