Documentation ¶
Index ¶
- func AsBytes(filename string) ([]byte, error)
- func AsBytesOrFail(t test.Failer, filename string) []byte
- func AsString(filename string) (string, error)
- func AsStringArray(files ...string) ([]string, error)
- func AsStringArrayOrFail(t test.Failer, files ...string) []string
- func AsStringOrFail(t test.Failer, filename string) string
- func MustAsBytes(filename string) []byte
- func MustAsString(filename string) string
- func NormalizePath(originalPath string) (string, error)
- func ReadDir(filePath string, extensions ...string) ([]string, error)
- func ReadDirOrFail(t test.Failer, filePath string, extensions ...string) []string
- func ReadTarFile(filePath string) (string, error)
- func WriteOrFail(t test.Failer, filePath string, contents []byte)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AsBytesOrFail ¶
AsBytesOrFail calls AsBytes and fails the test if any errors occurred.
func AsString ¶
AsString is a convenience wrapper around os.ReadFile that converts the content to a string.
func AsStringArray ¶
AsStringArray is a convenience wrapper around os.ReadFile that converts the content to a string.
func AsStringArrayOrFail ¶
AsStringArrayOrFail calls AsStringOrFail and then converts to string.
func AsStringOrFail ¶
AsStringOrFail calls AsBytesOrFail and then converts to string.
func MustAsBytes ¶
MustAsBytes calls AsBytes and panics the test if any errors occurred.
func MustAsString ¶
MustAsString calls MustAsBytes and then converts to string.
func NormalizePath ¶
NormalizePath expands the homedir (~) and returns an error if the file doesn't exist.
func ReadDir ¶
ReadDir returns the names of all files in the given directory. This is not recursive. The base path is appended; for example, ReadDir("dir") -> ["dir/file1", "dir/folder1"]
func ReadDirOrFail ¶
func ReadTarFile ¶
ReadTarFile reads a tar compress file from the embedded
Types ¶
This section is empty.