iotest

package
v0.5.4 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadFile added in v0.5.4

func ReadFile(t test.T, path string) string

ReadFile is a shortcut to os.ReadFile for tests.

func Stat added in v0.5.4

func Stat(t test.T, path string) fs.FileInfo

Stat is a shortcut to os.Stat for tests.

func TempFile

func TempFile(t test.T, prefix string) *os.File

TempFile creates a new temporary file inside the current test context.

It deletes the file when the test finishes.

func WriteFile added in v0.5.4

func WriteFile(t test.T, path, body string, perm os.FileMode)

WriteFile is a shortcut to os.WriteFile for tests.

Types

This section is empty.

Jump to

Keyboard shortcuts

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