testutil

package
v0.56.0 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package testutil holds small helpers shared by the tests of this module.

Dir exists because two needs meet in the same temporary directory: a test that binds a unix socket needs a path short enough for sockaddr_un.sun_path (t.TempDir() carries the test name and is not guaranteed to be), and every test's scratch files belong outside the repository - a directory under <repo>/tmp/ is scanned by `go list ./...` while another go command may be deleting it (issue suga-wab3).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dir

func Dir(t *testing.T) string

Dir returns a fresh temporary directory and removes it when the test ends. It is created under the system temporary directory (/tmp, %TEMP%), whose path is short; on unix the result is checked against the socket path limit, so a machine with an unusually long temporary directory fails here instead of in an opaque bind error. Like t.TempDir it may be called several times.

Types

This section is empty.

Jump to

Keyboard shortcuts

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