testing

package
v2.0.0-alpha.48 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendErr

func AppendErr(m *MultiError, err error)

AppendErr appends err to MultiError if err is not nil.

Types

type FileChecker

type FileChecker struct {
	Path   string
	Checks []func(string) error
}

FileChecker allows chaining multiple checks on a file path.

func NewFileChecker

func NewFileChecker(path string) *FileChecker

NewFileChecker creates a FileChecker for the given path.

func (*FileChecker) Check

func (fc *FileChecker) Check() error

Check runs all checks on the FileChecker's path, returning the first error encountered.

func (*FileChecker) Content

func (fc *FileChecker) Content(content string) *FileChecker

Content adds a check that the file at the path has the specified content.

func (*FileChecker) IsDir

func (fc *FileChecker) IsDir() *FileChecker

IsDir adds a check that the path is a directory.

func (*FileChecker) IsFile

func (fc *FileChecker) IsFile() *FileChecker

IsFile adds a check that the path is a regular file.

func (fc *FileChecker) IsSymlink() *FileChecker

IsSymlink adds a check that the path is a symlink.

func (*FileChecker) ModeEquals

func (fc *FileChecker) ModeEquals(perm os.FileMode) *FileChecker

ModeEquals adds a check that the path has the specified permission bits.

func (*FileChecker) Owner

func (fc *FileChecker) Owner(uid, gid int) *FileChecker

Owner adds a check that the path has the specified uid and gid.

type MultiError

type MultiError []error

MultiError aggregates multiple errors into one.

func (MultiError) Error

func (m MultiError) Error() string

Jump to

Keyboard shortcuts

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