type ReadDirFS … // ReadDir reads the named directory // and returns a list of directory entries sorted by filename. // // If fs implements [ReadDirFS], ReadDir calls fs.ReadDir. // Otherwise ReadDir calls fs.Open and uses ReadDir and Close // on the returned file. func ReadDir(fsys FS, name string) ([]DirEntry, error) { … } type dirInfo … func (di dirInfo) IsDir() bool { … } func (di dirInfo) Type() FileMode { … } func (di dirInfo) Info() (FileInfo, error) { … } func (di dirInfo) Name() string { … } func (di dirInfo) String() string { … } // FileInfoToDirEntry returns a [DirEntry] that returns information from info. // If info is nil, FileInfoToDirEntry returns nil. func FileInfoToDirEntry(info FileInfo) DirEntry { … }