Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FSTemporaryDir ¶
type FSTemporaryDir struct {
// contains filtered or unexported fields
}
FSTemporaryDir hands out sandboxes inside a single parent directory owned by this process.
One parent rather than one directory per sandbox is what makes cleanup a single removal, and what makes an interrupted run leave one identifiable directory instead of a scattering of them. The owning process id is in the name so a later run can tell an abandoned parent from one that is still in use.
func New ¶
func New(prefix string) *FSTemporaryDir
func (*FSTemporaryDir) New ¶
func (f *FSTemporaryDir) New() string
New returns a fresh directory inside this process's parent, creating the parent on first use.
func (*FSTemporaryDir) RemoveAll ¶ added in v0.2.0
func (f *FSTemporaryDir) RemoveAll() error
RemoveAll deletes every sandbox this process handed out, and the parent.
It reports the failure rather than panicking. This runs as cleanup, often while a test is already failing for its own reasons, and a panic here would replace that diagnosis with one about a temporary directory. A parent that survives is named after a process id, so it is reclaimable rather than lost.