utils

package
v0.0.0-...-cc0c603 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearDir

func ClearDir(dirPath string) error

ClearDir removes all the entries from the given directory.

func CommonPrefix

func CommonPrefix(strs ...string) string

CommonPrefix returns the common root of all the given strings.

func CreateDir

func CreateDir(dirPath string) error

CreateDir creates a directory at the given path. If it already exists, its content is cleared. If a file exists at this path, is it overridden.

func FileStat

func FileStat(filePath string) (stat os.FileInfo, exists bool, err error)

FileStat executes a stat against the file at the given path. If the file does not exist, no error but false is returned.

func FormatDirName

func FormatDirName(s3Dir string) string

func FormatDuration

func FormatDuration(d time.Duration) string

func GetAllRegexNameGroups

func GetAllRegexNameGroups(re *regexp.Regexp, str string) (map[string]string, bool)

func GetRegexMatchGroup

func GetRegexMatchGroup(re *regexp.Regexp, str string, group int) (string, bool)

func GetRegexNameGroup

func GetRegexNameGroup(re *regexp.Regexp, str, groupName string) (string, bool)

func Map

func Map[I, O any](s []I, fn func(I) O) []O

func Min

func Min[T cmp.Ordered](x T, y ...T) T

Min returns the minimum number among all the given values.

Types

This section is empty.

Jump to

Keyboard shortcuts

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