OnlyFiles returns a new fs.FS that only contains files. If a directory is requested, os.ErrNotExist is returned. This prevents directory listings from being served.
(files fs.FS)
| 752 | // requested, os.ErrNotExist is returned. This prevents directory listings from |
| 753 | // being served. |
| 754 | func OnlyFiles(files fs.FS) fs.FS { |
| 755 | return justFilesSystem{FS: files} |
| 756 | } |
| 757 | |
| 758 | type justFilesSystem struct { |
| 759 | FS fs.FS |
no outgoing calls