Skip to content

Commit f79afc7

Browse files
committed
Removed processing of errors that cannot occur
1 parent 2c0e662 commit f79afc7

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

route_frontend.go

+2-8
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,11 @@ func (pfs protectedFileSystem) Open(filepath string) (http.File, error) {
1717
if err != nil {
1818
return nil, err
1919
}
20-
stat, err := file.Stat()
21-
if err != nil {
22-
return nil, err
23-
}
24-
20+
stat, _ := file.Stat()
2521
if stat.IsDir() {
2622
index := path.Join(filepath, "index.html")
2723
if _, err := pfs.fs.Open(index); err != nil {
28-
if cerr := file.Close(); cerr != nil {
29-
return nil, cerr
30-
}
24+
_ = file.Close()
3125
return nil, err
3226
}
3327
}

0 commit comments

Comments
 (0)