package
0.0.0-20250122105845-0acfdd5a5212
Repository: https://github.com/function61/gokit.git
Documentation: pkg.go.dev

# Functions

makes (background-derived) context that cancels on SIGINT ("Ctrl + c") or SIGTERM.
tries its best to preserve metadata like file permissions & timestamps.
does the same as "$ touch".
No description provided by the author
https://stackoverflow.com/questions/12518876/how-to-check-if-a-file-exists-in-go follows symlinks.
No description provided by the author
if "err" is non-nil, exits with exit code 1 and prints the given error to stderr intended to be ran once from program's entrypoint / main function this abstraction seems silly, but I've written this so many times, and some of the times wrong (stdout instead of stderr), that maybe it's better to write this properly once.
- ensures a file with given name only appears on the filesystem if all its file operations succeed - tries to clean up temp file on failure of *operations* or the atomic rename.
typesafe interface for specifying "chmod bits" in human readable way.
No description provided by the author
No description provided by the author
first tries by renaming, if that errors falls back to copying (so it works across filesystems).
No description provided by the author
- creates a <filename>.part file to write to - write all requested content to it (content produced by callback) - rename temp filename to filename if everything went OK If encountering any errors, removes the partial file.
helper for the most common case of pumping content to file from a reader.
No description provided by the author
same as WriteFileChown() but if copying to filesystem that doesn't support Chown(), we'll get an error which we'll ignore.
if running under '$ sudo', set the sudo-invoking "original" user as the UID & GID.
No description provided by the author
warning: ctime is ignored for now.
write an extended attribute, in user namespace.

# Constants

leaving out combinations that semantically don't make sense: (X), (W,X) - execute without read (W) - write without read.
leaving out combinations that semantically don't make sense: (X), (W,X) - execute without read (W) - write without read.
leaving out combinations that semantically don't make sense: (X), (W,X) - execute without read (W) - write without read.
leaving out combinations that semantically don't make sense: (X), (W,X) - execute without read (W) - write without read.
leaving out combinations that semantically don't make sense: (X), (W,X) - execute without read (W) - write without read.
leaving out combinations that semantically don't make sense: (X), (W,X) - execute without read (W) - write without read.
leaving out combinations that semantically don't make sense: (X), (W,X) - execute without read (W) - write without read.
leaving out combinations that semantically don't make sense: (X), (W,X) - execute without read (W) - write without read.
leaving out combinations that semantically don't make sense: (X), (W,X) - execute without read (W) - write without read.
leaving out combinations that semantically don't make sense: (X), (W,X) - execute without read (W) - write without read.
owner means "user", but I chose to go against the flow because it's more semantic.
leaving out combinations that semantically don't make sense: (X), (W,X) - execute without read (W) - write without read.
leaving out combinations that semantically don't make sense: (X), (W,X) - execute without read (W) - write without read.
leaving out combinations that semantically don't make sense: (X), (W,X) - execute without read (W) - write without read.
leaving out combinations that semantically don't make sense: (X), (W,X) - execute without read (W) - write without read.

# Type aliases

No description provided by the author