Documentation
¶
Overview ¶
Package scratch is the process's transient directory: one run root under the system temporary directory that every short-lived directory dockhand makes is created inside, workspaces, their overlays, materialized sources, helper sandboxes, and edit buffers among them. The root is removed when the process ends normally, and it is held under an advisory lock while the process lives, so a root whose lock can be taken belongs to a process that died without cleaning up and is swept by the next process that opens a root. Nothing meant to outlive a command lives here: the state database, verification artifacts and logs, the Tart pool, and the index cache have their own configured homes.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Close ¶
func Close() error
Close removes the process's run root and releases its lock. A later Dir makes a new root.
func Dir ¶
Dir creates a new directory under the process's run root, named by the pattern as os.MkdirTemp names one. The caller removes it when done; the root's removal at exit, or a later sweep, catches what it did not.
func Root ¶
Root returns the process's run root, creating and locking it on first use. A creation also sweeps the roots of dead processes, on a best-effort basis. A root that was removed from under the process, as a test's temporary directory is removed when the test ends, is replaced by a new one under the temporary directory of the moment.
Types ¶
This section is empty.