scratch

package
v0.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 5, 2026 License: MIT Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

func Dir(pattern string) (string, error)

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

func Root() (string, error)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL