Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AbsPath ¶
AbsPath is a convenience wrapper around filepath.Abs that accepts a string pointer, base, and updates it on successful resolution.
func IsNotExist ¶
IsNotExist calls os.IsNotExist on the unwrapped err.
func MakeDirs ¶
MakeDirs is a convenience wrapper around os.MkdirAll that applies a 0755 mask to all created directories.
func MakeReadOnly ¶
MakeReadOnly recursively iterates through all of the files and directories starting at path and marks them read-only.
func RemoveAll ¶
RemoveAll is a wrapper around os.RemoveAll which makes sure all files are writeable (recursively) prior to removing them.
Types ¶
type TempDir ¶
type TempDir struct { // Dir is the base diectory. If empty, the default will be used (see // ioutil.TempDir) Dir string // Prefix is the prefix to apply to the temporary directory. If empty, a // default will be used (see ioutil.TempDir). Prefix string // OnCleanupErr, if not nil, will be called if TempDir cleanup fails. // // If nil, cleanup errors will be silently discarded. CleanupErrFunc func(tdir string, err error) }
TempDir configures a temporary directory.
func (*TempDir) With ¶
With creates a temporary directory and passes it to fn. After fn exits, the directory and all of its contents is deleted.
Any error that happens during setup or execution of the callback is returned. If an error occurs during cleanup, the optional CleanupErrFunc will be called.