Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockFS ¶
type MockFS struct { // OpenFunc allows for customizing the behavior of the Open method. OpenFunc func(name string) (fs.File, error) }
MockFS provides a mock implementation of the fs.FS interface.
type MockFile ¶
type MockFile struct { // Content simulates the content of the file. Read operations will return data from this slice. Content []byte // CloseFunc is an optional function that simulates closing the file. It allows users to // specify custom behavior for the Close method, including simulating errors. CloseFunc func() error // contains filtered or unexported fields }
MockFile is a mock implementation of the fs.File interface.
func (*MockFile) Read ¶
Read attempts to read bytes from the MockFile into b. It simulates reading by copying bytes from mf.Content into b, starting from the current read position. Returns the number of bytes read and an error, if any. Once all content has been read, subsequent calls will return io.EOF.
Click to show internal directories.
Click to hide internal directories.