tempdir

package
v0.0.0-...-810cf82 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dir

type Dir struct {
	Path string
	// contains filtered or unexported fields
}

func New

func New(t testing.TB) Dir

func (Dir) CheckEmpty

func (d Dir) CheckEmpty()

Check whether the given directory is empty. Marks test failed on problems, and on any files seen.

func (Dir) Cleanup

func (d Dir) Cleanup()

func (Dir) Subdir

func (d Dir) Subdir(name string) string

Utility function to create a new subdirectory. This can be used to have more predictable path names in a test that needs multiple temp directories: only make the top one have a random name, name subdirectories by their role in the test.

Name must be a valid single path segment, no slashes.

Returns an absolute path.

Jump to

Keyboard shortcuts

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