Skip to content

Commit 16c9748

Browse files
author
hellojukay
committed
解决在 go1.17.5 下无法编译的问题
1 parent 7210fc2 commit 16c9748

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

fs.go

+13-13
Original file line numberDiff line numberDiff line change
@@ -605,19 +605,19 @@ func serveFile(w http.ResponseWriter, r *http.Request, fs FileSystem, name strin
605605
}
606606

607607
// use contents of index.html for directory, if present
608-
if d.IsDir() {
609-
index := strings.TrimSuffix(name, "/") + indexPage
610-
ff, err := fs.Open(index)
611-
if err == nil {
612-
defer ff.Close()
613-
dd, err := ff.Stat()
614-
if err == nil {
615-
name = index
616-
d = dd
617-
f = ff
618-
}
619-
}
620-
}
608+
// if d.IsDir() {
609+
// index := strings.TrimSuffix(name, "/") + indexPage
610+
// ff, err := fs.Open(index)
611+
// if err == nil {
612+
// defer ff.Close()
613+
// dd, err := ff.Stat()
614+
// if err == nil {
615+
// name = index
616+
// d = dd
617+
// f = ff
618+
// }
619+
// }
620+
// }
621621

622622
// Still a directory? (we didn't find an index.html file)
623623
if d.IsDir() {

0 commit comments

Comments
 (0)