summaryrefslogtreecommitdiff
path: root/system/admin/filesystem.go
diff options
context:
space:
mode:
authorSteve Manuel <nilslice@gmail.com>2016-11-29 11:17:04 -0800
committerSteve Manuel <nilslice@gmail.com>2016-11-29 11:17:04 -0800
commit62d6f575ae1acd6b23be5cd2c774234834c8c9ea (patch)
treedbd3fad5a2ce41d5869d6ecef6649da1aa98fdd2 /system/admin/filesystem.go
parentb4c23191e24ece14336628d26ec854f82b54219e (diff)
fmt code
Diffstat (limited to 'system/admin/filesystem.go')
-rw-r--r--system/admin/filesystem.go21
1 files changed, 10 insertions, 11 deletions
diff --git a/system/admin/filesystem.go b/system/admin/filesystem.go
index 4e64a26..77c721e 100644
--- a/system/admin/filesystem.go
+++ b/system/admin/filesystem.go
@@ -1,13 +1,12 @@
package admin
import (
- "net/http"
+ "net/http"
"os"
)
-
func restrict(dir http.Dir) justFilesFilesystem {
- return justFilesFilesystem{dir}
+ return justFilesFilesystem{dir}
}
// the code below removes the open directory listing when accessing a URL which
@@ -16,21 +15,21 @@ func restrict(dir http.Dir) justFilesFilesystem {
// credit: Brad Fitzpatrick (c) 2012
type justFilesFilesystem struct {
- fs http.FileSystem
+ fs http.FileSystem
}
func (fs justFilesFilesystem) Open(name string) (http.File, error) {
- f, err := fs.fs.Open(name)
- if err != nil {
- return nil, err
- }
- return neuteredReaddirFile{f}, nil
+ f, err := fs.fs.Open(name)
+ if err != nil {
+ return nil, err
+ }
+ return neuteredReaddirFile{f}, nil
}
type neuteredReaddirFile struct {
- http.File
+ http.File
}
func (f neuteredReaddirFile) Readdir(count int) ([]os.FileInfo, error) {
- return nil, nil
+ return nil, nil
}