diff options
author | Steve Manuel <nilslice@gmail.com> | 2016-11-29 11:17:04 -0800 |
---|---|---|
committer | Steve Manuel <nilslice@gmail.com> | 2016-11-29 11:17:04 -0800 |
commit | 62d6f575ae1acd6b23be5cd2c774234834c8c9ea (patch) | |
tree | dbd3fad5a2ce41d5869d6ecef6649da1aa98fdd2 | |
parent | b4c23191e24ece14336628d26ec854f82b54219e (diff) |
fmt code
-rw-r--r-- | system/admin/filesystem.go | 21 |
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 } |