testutil

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockFS

type MockFS struct {
	fstest.MapFS
}

MockFS is a mock filesystem implementation for testing It's based on fstest.MapFS and provides a simple in-memory filesystem

func NewMockFS

func NewMockFS() *MockFS

NewMockFS creates a new mock filesystem.

func (*MockFS) Lstat

func (m *MockFS) Lstat(name string) (fs.FileInfo, error)

Lstat implements types.FS

func (*MockFS) MkdirAll

func (m *MockFS) MkdirAll(path string, perm fs.FileMode) error

MkdirAll implements types.FS

func (*MockFS) ReadDir

func (m *MockFS) ReadDir(name string) ([]fs.DirEntry, error)

ReadDir implements types.FS

func (*MockFS) ReadFile

func (m *MockFS) ReadFile(name string) ([]byte, error)

ReadFile implements types.FS

func (m *MockFS) Readlink(name string) (string, error)

Readlink implements types.FS

func (*MockFS) Remove

func (m *MockFS) Remove(name string) error

Remove implements types.FS

func (*MockFS) RemoveAll

func (m *MockFS) RemoveAll(path string) error

RemoveAll implements types.FS

func (*MockFS) Stat

func (m *MockFS) Stat(name string) (fs.FileInfo, error)

Stat implements types.FS

func (m *MockFS) Symlink(oldname, newname string) error

Symlink implements types.FS

func (*MockFS) WriteFile

func (m *MockFS) WriteFile(name string, data []byte, perm fs.FileMode) error

WriteFile implements types.FS

Jump to

Keyboard shortcuts

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