Documentation
¶
Overview ¶
fs provides most of the functionality that the io/fs package provides and serves as a stand-in replacement. It also allows to mock out the file system in tests.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Create ¶
Create creates a file in the filesystem, returning the file and an error, if any happens.
func ReadFile ¶
ReadFile is a shorthand for fs.Open followed by io.ReadAll. It returns the first encountered non-nil error.
func SetGlobalFileSystem ¶
SetGlobalFileSystem sets the FS to use by all the functions in this package. It allows to switch between OS FS and mock FS during tests. This function is not thread safe and should not be called concurrently.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.