Documentation ¶
Overview ¶
Package fileutil provides functionality to replace os and io calls with custom filesystems. It is a small wrapper around io/fs.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // FS is the filesystem that Open, ReadFile and ReadDir will query. FS fs.FS = os.DirFS(".") // FixWindowsPaths will reset all file paths loaded to replace windows style slashes // with unix style slashes. This is important when using io/fs or embed, because the // path/filepath package will produce windows style paths on a windows system, but // these stdlib packages will reject all windows paths. FixWindowsPaths = true // OSFallback will fallback to loading via os.Open / io.ReadFile if loading otherwise fails. // This is necessary when reading system level fallback fonts. Fixed paths will not be applied // to this fallback route. OSFallback = true )
Functions ¶
func Open ¶
func Open(file string) (io.ReadCloser, error)
Open is a wrapper around os.Open that will also check FS to access embedded data. The intended use is to use the an embedding library to create an Asset function that matches this signature.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.