fstest

package
v2.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2022 License: GPL-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package fstest provides test utilties to operate with files and directories

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Chmod

func Chmod(t *testing.T, name string, mode os.FileMode)

Chmod is wrappoer of os.Chmod that fails the test if chmod returns an error.

func TempDir

func TempDir(t *testing.T) string

TempDir returns a path, with all symlinks in it resolved, to a unique temporary directory. The directory is removed via t.Cleanup() on termination of the test. (On MacOS t.TempDir() returns a symlink.)

func WriteToFile

func WriteToFile(t *testing.T, data []byte, path string)

WriteToFile writes data to a file. Directories that are in the path but do not exist are created. If an error happens, t.Fatal() is called.

Types

This section is empty.

Jump to

Keyboard shortcuts

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