utils

package module
v0.0.0-...-1cfd4fd Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2021 License: MIT Imports: 18 Imported by: 0

README

utils

collection of things

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Logfile *os.File
	ErrLog  *log.Logger
)

Functions

func CheckErr

func CheckErr(err error, str string)

prints to log then panic if err

func CleanTimeStamp

func CleanTimeStamp(s string) string

2020-09-02 15:16:15:415 --> 2020-09-02 15:16:15

func ClearWindow

func ClearWindow()

func CopyDir

func CopyDir(src, dest string) error

CopyDir copies a directory from src to dest, recursively copying nested directories

func CopyFile

func CopyFile(src, dest string) error

CopyFile copies a file from the src to dest

func DebugErr

func DebugErr(err error, str string)

only prints errors to log

func FileExists

func FileExists(filepath string) (bool, error)

FileExists checks if the file exists at the given path

func GenerateUUID

func GenerateUUID() (string, error)

GenerateUUID returns a uuid v4 in string

func InitLog

func InitLog()

func IsNumber

func IsNumber(s string) bool

IsNumber checks if the given string is in the form of a number

func OpenBrowser

func OpenBrowser(url string)

func PrintHeader

func PrintHeader(str string)

func ReadFileAbs

func ReadFileAbs(relpath string) []byte

ReadFileAbs reads the content of the file with the given file path by resolving it as an absolute path

func ResizeWindow

func ResizeWindow()

func StripNONALPHANUMERIC

func StripNONALPHANUMERIC(str string) string

strips all non alphanumeric except ./-_

func StripString

func StripString(s string) string

clean ansi codes and space from string

func TrimString

func TrimString(str string) string

trim space from string

Types

This section is empty.

Directories

Path Synopsis
Package assert provides functions to assert a condition in tests
Package assert provides functions to assert a condition in tests
Package clock provides an abstract layer over the standard time package
Package clock provides an abstract layer over the standard time package

Jump to

Keyboard shortcuts

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