Imports #
"errors"
"internal/bytealg"
"internal/stringslite"
"io"
"io/fs"
"time"
"errors"
"internal/bytealg"
"internal/stringslite"
"io"
"io/fs"
"time"
var _ fs.ReadDirFS = FS{...}var _ fs.ReadFileFS = FS{...}var _ fs.FileInfo = *ast.CallExprvar _ fs.DirEntry = *ast.CallExprvar _ io.Seeker = *ast.CallExprvar _ io.ReaderAt = *ast.CallExprdotFile is a file for the root directory, which is omitted from the files list in a FS.
var dotFile = *ast.UnaryExprAn FS is a read-only collection of files, usually initialized with a //go:embed directive. When declared without a //go:embed directive, an FS is an empty file system. An FS is a read-only value, so it is safe to use from multiple goroutines simultaneously and also safe to assign values of type FS to each other. FS implements fs.FS, so it can be used with any package that understands file system interfaces, including net/http, text/template, and html/template. See the package documentation for more details about initializing an FS.
type FS struct {
files *[]file
}A file is a single file in the FS. It implements fs.FileInfo and fs.DirEntry.
type file struct {
name string
data string
hash [16]byte
}An openDir is a directory open for reading.
type openDir struct {
f *file
files []file
offset int
}An openFile is a regular file open for reading.
type openFile struct {
f *file
offset int64
}func (f *openFile) Close() errorfunc (d *openDir) Close() errorfunc (f *file) Info() (fs.FileInfo, error)func (f *file) IsDir() boolfunc (f *file) ModTime() time.Timefunc (f *file) Mode() fs.FileModefunc (f *file) Name() stringOpen opens the named file for reading and returns it as an [fs.File]. The returned file implements [io.Seeker] and [io.ReaderAt] when the file is not a directory.
func (f FS) Open(name string) (fs.File, error)func (d *openDir) Read([]byte) (int, error)func (f *openFile) Read(b []byte) (int, error)func (f *openFile) ReadAt(b []byte, offset int64) (int, error)func (d *openDir) ReadDir(count int) ([]fs.DirEntry, error)ReadDir reads and returns the entire named directory.
func (f FS) ReadDir(name string) ([]fs.DirEntry, error)ReadFile reads and returns the content of the named file.
func (f FS) ReadFile(name string) ([]byte, error)func (f *openFile) Seek(offset int64, whence int) (int64, error)func (f *file) Size() int64func (f *openFile) Stat() (fs.FileInfo, error)func (d *openDir) Stat() (fs.FileInfo, error)func (f *file) String() stringfunc (f *file) Sys() anyfunc (f *file) Type() fs.FileModelookup returns the named file, or nil if it is not present.
func (f FS) lookup(name string) *filereadDir returns the list of files corresponding to the directory dir.
func (f FS) readDir(dir string) []filesortSearch is like sort.Search, avoiding an import.
func sortSearch(n int, f func(int) bool) intsplit splits the name into dir and elem as described in the comment in the FS struct above. isDir reports whether the final trailing slash was present, indicating that name is a directory.
func split(name string) (dir string, elem string, isDir bool)Generated with Arrow