utils

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2024 License: MIT Imports: 20 Imported by: 5 modules, 19 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompL

func CompL[T any, V any](objs []T, lambda func(x T) V) []V

func Contains

func Contains(s []string, str string) bool

func FileExists

func FileExists(filename utils_types.FilePath) bool

func GetCurrentFile

func GetCurrentFile() utils_types.FilePath

func GetCurrentFolder

func GetCurrentFolder() utils_types.FilePath

func GetCurrrentChildFolder

func GetCurrrentChildFolder(folder_name string) utils_types.FilePath

func GetCurrrentTempFolder

func GetCurrrentTempFolder() utils_types.FilePath

func GetCurrrentTestFolder

func GetCurrrentTestFolder() utils_types.FilePath

func GetProjectDir

func GetProjectDir() utils_types.FilePath

func InitRegexExpression

func InitRegexExpression(regex **regexp.Regexp, expression utils_types.RegExp)

func Keys

func Keys[M ~map[K]V, K comparable, V any](m M) []K

Keys returns the keys of the map m. The keys will be an indeterminate order.

func NewReadFile

func NewReadFile(filepath utils_types.FilePath, callback func(*FileRead))

func NewWriteFile

func NewWriteFile(filepath utils_types.FilePath, callback func(*FileWrite))

func Ptr

func Ptr[T any](v T) *T

func RegenerativeTest

func RegenerativeTest(callback func() error) error

func ReverseSlice

func ReverseSlice(s interface{})

func ShellRunArgs

func ShellRunArgs(program string, args ...string)

func SleepAwaitCtrlC

func SleepAwaitCtrlC()

func SleepForever

func SleepForever()

func StringWithCharset

func StringWithCharset(length int, charset string) string

func TmpRender

func TmpRender(templateRef *template.Template, data interface{}) string

func TokenHex

func TokenHex(length int) string

Types

type ErrorNotFound

type ErrorNotFound struct {
}

func (ErrorNotFound) Error

func (err ErrorNotFound) Error() string

type FileRead

type FileRead struct {
	// contains filtered or unexported fields
}

func (*FileRead) ReadLines

func (f *FileRead) ReadLines() []string

type FileWrite

type FileWrite struct {
	// contains filtered or unexported fields
}

func (*FileWrite) WritelnF

func (f *FileWrite) WritelnF(msg string)

Jump to

Keyboard shortcuts

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