Help us shape the future of Go! Take the 2026 Go Developer Survey

scratch

package
v0.1.14 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package scratch owns temporary working directories and stale temp cleanup.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Cleanup

func Cleanup()

Cleanup removes all paths still registered by this process.

func Dir

func Dir(prefix string) (string, error)

Dir creates and registers an ephemeral directory in the system temp directory.

func DirIn

func DirIn(parent, prefix string) (string, error)

DirIn creates and registers an ephemeral directory in parent ("" for the system temp directory).

func File

func File(dir, pattern string) (*os.File, error)

File registers an atomic-write temporary file beside its destination.

func Prune

func Prune(dir string)

Prune removes only owned, known scratch names in dir older than six hours.

func Remove

func Remove(path string) error

Remove removes a registered path, retrying while helpers release files.

func Start

func Start()

Start prunes the system temp directory once per process.

Types

This section is empty.

Jump to

Keyboard shortcuts

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