package
0.0.0-20241116165817-883d5d7d379c
Repository: https://github.com/ddkwork/toolbox.git
Documentation: pkg.go.dev
# Functions
BaseName returns the file name without the directory or extension.
Copy src to dst.
CopyWithMask src to dst.
CreateTemp is essentially the same as os.CreateTemp, except it allows you to specify the file mode of the newly created file.
FileExists returns true if the path points to a regular file.
FileIsReadable returns true if the path points to a regular file that we have permission to read.
IsDir returns true if the specified path exists and is a directory.
LoadJSON data from the specified path.
LoadJSONFromFS data from the specified filesystem path.
LoadYAML data from the specified path.
LoadYAMLFromFS data from the specified filesystem path.
MoveFile moves a file in the file system or across volumes, using rename if possible, but falling back to copying the file if not.
SanitizeName sanitizes a file name by replacing invalid characters.
SaveJSON data to the specified path.
SaveJSONWithMode data to the specified path.
SaveYAML data to the specified path.
SaveYAMLWithMode data to the specified path.
Split a path into its component parts.
TrimExtension trims any extension from the path.
UniquePaths returns a list of unique paths from the given paths, pruning out paths that are a subset of another.
UnsanitizeName reverses the effects of a call to SanitizeName.
Walk performs the same function as filepath.Walk() does, but works on http.FileSystem objects.