summaryrefslogtreecommitdiff
path: root/system/admin/filesystem.go
diff options
context:
space:
mode:
authorSteve <nilslice@gmail.com>2016-11-29 12:03:26 -0800
committerGitHub <noreply@github.com>2016-11-29 12:03:26 -0800
commitd11d86d73aebc2fc95eedebb166c58962762db2d (patch)
tree56e99f446ac5343297e9ff72f667930ec89948e9 /system/admin/filesystem.go
parentf252472047f86d1bdf956dc59b89541ea0260d68 (diff)
parentc50ae920c84b00eea7e7a896bff5546d1e013c16 (diff)
Merge pull request #18 from bosssauce/ponzu-dev
[tooling] Add Rails-like content generator for Content Types
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
}