MCPcopy Index your code
hub / github.com/coder/coder / OnlyFiles

Function OnlyFiles

site/site.go:754–756  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

752// requested, os.ErrNotExist is returned. This prevents directory listings from
753// being served.
754func OnlyFiles(files fs.FS) fs.FS {
755 return justFilesSystem{FS: files}
756}
757
758type justFilesSystem struct {
759 FS fs.FS

Callers 2

TestJustFilesSystemFunction · 0.92
NewFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestJustFilesSystemFunction · 0.74