package
0.0.0-20250104174517-3e694fc5c362
Repository: https://github.com/softwarespot/go-helpers.git
Documentation: pkg.go.dev
# Functions
DirExists checks if the specified directory exists and is a directory.
EnsureDir ensures that the specified directory exists, creating it if it does not.
FileExists checks if the specified file path exists and is not a directory.
FileModTime gets the modified time of the file path.
FormatAsDateTime formats a given time.Time value into a string representation in the format "YYYY-MM-DD HH:MM:SS" based on the current local time zone.
No description provided by the author
ID generates a unique identifier of type T, which must be a string type i.e.
IsPiped determines whether the application is piped to another application or not.
Must returns the result if there is no error; otherwise, it panics with the provided error.
NewFlock creates a new Flock instance for the specified file path.
ParseAsDateTime parses a string representation of date and time in the format "YYYY-MM-DD HH:MM:SS" into a time.Time value based on the local time zone.
RecoverFunc is a helper function that recovers from panics in a given function.
Retry retries a function on error, and continues until successful or the maximum number of retries has exceeded.
SliceAt returns the element at the specified index in the slice.
SliceUnique returns a new slice containing only the unique elements from the provided slice.
Tildify replaces the user's home directory with a tilde ("~").
No description provided by the author
Untildify replaces the tilde ("~") with the user's home directory.
UserCacheDir returns the user's cache directory as a string.
UserHomeDir returns the user's home directory as a string.
# Variables
ErrFlockTimeout is returned when obtaining advisory lock on a file descriptor times out.