27 lines
428 B
Go
27 lines
428 B
Go
|
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
|
||
|
}
|