testfs

package
v0.0.0-...-e7509a3 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2024 License: Apache-2.0 Imports: 6 Imported by: 1

Documentation

Overview

Package testfs implements a test filesystem.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Build

func Build(base string, layout map[string]string) error

Build constructs a filesystem hierarchy given a layout.

The layouts keys should be ToSlash-style file paths. Its values should be the content that is written at those paths. Intermediate directories will be automatically created.

To create a directory, end its path with a "/". In this case, the content will be ignored.

func Collect

func Collect(base string) (map[string]string, error)

Collect constructs layout from a given directory.

This function does reverse of Build. Content of empty directory is represented as "" with "/" suffix. But this does not work if there are symlink entries under |base| dir.

Types

This section is empty.

Jump to

Keyboard shortcuts

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