asttest

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MemFS

type MemFS struct {
	// contains filtered or unexported fields
}

MemFS represents a file system in memory.

func NewMemFS

func NewMemFS(dirs map[string][]string, files map[string]string) *MemFS

NewMemFS creates a MemFS instance.

func NewSingleFileFS

func NewSingleFileFS(dir string, fname string, data string) *MemFS

NewSingleFileFS creates a file system that only contains a single file.

func (*MemFS) Join

func (p *MemFS) Join(elem ...string) string

Join joins any number of path elements into a single path, separating them with slashes. Empty elements are ignored. The result is Cleaned. However, if the argument list is empty or all its elements are empty, Join returns an empty string.

func (*MemFS) ReadDir

func (p *MemFS) ReadDir(dirname string) ([]os.FileInfo, error)

ReadDir reads the directory named by dirname and returns a list of directory entries sorted by filename.

func (*MemFS) ReadFile

func (p *MemFS) ReadFile(filename string) ([]byte, error)

ReadFile reads the file named by filename and returns the contents. A successful call returns err == nil, not err == EOF. Because ReadFile reads the whole file, it does not treat an EOF from Read as an error to be reported.

Jump to

Keyboard shortcuts

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