Documentation
¶
Index ¶
- func Chdir(t *testing.T, dir string)
- func CombinedPaths(environ []string) string
- func Create(t *testing.T, name string)
- func CreateNoCleanup(t *testing.T, name string)
- func DirectoryLink(t *testing.T, target, link string)
- func Setenv(t *testing.T, key string, value string)
- func Setenvs(t *testing.T, envContext map[string]string)
- func Symlink(t *testing.T, target, link string)
- func Unsetenv(t *testing.T, key string)
- func Unsetenvs(t *testing.T, keys []string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Chdir ¶
Chdir changes the current working directory to the named directory. The working directory is automatically restored as part of Cleanup.
func CombinedPaths ¶
CombinedPaths collects all PATH strings from the provided environment variables, in the form of 'PATH=<path>', and combines them into a single PATH string, also in the form of 'PATH=<collected paths>'. It returns an empty string if no PATH strings are found.
func Create ¶
Create creates or truncates the named file. If the file already exists, it is truncated. If the file does not exist, it is created with mode 0666 (before umask). Files created are automatically removed during test Cleanup. Ignores errors due to the file already being deleted.
func CreateNoCleanup ¶
Create creates or truncates the named file. If the file already exists, it is truncated. If the file does not exist, it is created with mode 0666 (before umask).
func DirectoryLink ¶ added in v1.36.0
DirectoryLink creates a directory symlink, or a junction on Windows without requiring symlink privileges.
func Setenvs ¶
Setenvs sets the provided environment variables keys with their corresponding values. Any set values are automatically restored during test Cleanup.
func Symlink ¶ added in v1.36.0
Symlink creates a symbolic link, skipping only when Windows denies the symlink privilege.
Types ¶
This section is empty.