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 ¶
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.