neutered-filesystem/neutered-filesystem.go

27 lines
428 B
Go
Raw Normal View History

2021-12-24 01:14:18 +00:00
package neutered_filesystem
import (
"net/http"
"os"
)
type NeuteredFileSystem struct {
fs http.FileSystem
}
func (fs NeuteredFileSystem) Open(name string) (http.File, error) {
f, err := fs.fs.Open(name)
if err != nil {
return nil, err
}
return neuteredReaddirFile{f}, nil
}
type neuteredReaddirFile struct {
http.File
}
func (f neuteredReaddirFile) Readdir(count int) ([]os.FileInfo, error) {
return nil, nil
}