friendtest

package
v1.2.21 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package friendtest holds the test doubles of pkg/friend that tests in other packages share.

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 is the in-memory twin of friend.OSFS, a friend.SettingsFS: directories, files and symlinks by clean absolute path. A write wants its parent a directory; MkdirAll refuses a component that is a file or a symlink.

func NewMemFS

func NewMemFS() *MemFS

NewMemFS is an empty twin holding only the root.

func (*MemFS) Lstat

func (m *MemFS) Lstat(p string) (friend.Entry, error)

func (*MemFS) MkdirAll

func (m *MemFS) MkdirAll(p string, _ fs.FileMode) error

func (*MemFS) ReadFile

func (m *MemFS) ReadFile(p string) ([]byte, error)
func (m *MemFS) Symlink(target, p string)

Symlink makes p a symlink to target, its parent created.

func (*MemFS) WriteFile

func (m *MemFS) WriteFile(p string, data []byte, _ fs.FileMode) error

Jump to

Keyboard shortcuts

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