diff --git a/internal/router/router.go b/internal/router/router.go index bfb53e352..100e0b38e 100644 --- a/internal/router/router.go +++ b/internal/router/router.go @@ -46,7 +46,7 @@ type Router interface { AttachMiddleware(handler gin.HandlerFunc) // Attach 404 NoRoute handler AttachNoRouteHandler(handler gin.HandlerFunc) - // Add Gin StaticFile handler + // Add Gin StaticFile handler AttachStaticFS(relativePath string, fs http.FileSystem) // Start the router Start() @@ -63,9 +63,9 @@ type router struct { certManager *autocert.Manager } -// Add Gin StaticFile handler +// Add Gin StaticFile handler func (r *router) AttachStaticFS(relativePath string, fs http.FileSystem) { - r.engine.StaticFS(relativePath, fs); + r.engine.StaticFS(relativePath, fs) } // Start starts the router nicely. diff --git a/internal/web/fileserver.go b/internal/web/fileserver.go index 408db3293..247bf0dc8 100644 --- a/internal/web/fileserver.go +++ b/internal/web/fileserver.go @@ -35,7 +35,7 @@ func (fs FileSystem) Open(path string) (http.File, error) { return nil, err } - s, err := f.Stat() + s, _ := f.Stat() if s.IsDir() { index := strings.TrimSuffix(path, "/") + "/index.html" if _, err := fs.fs.Open(index); err != nil { @@ -44,4 +44,4 @@ func (fs FileSystem) Open(path string) (http.File, error) { } return f, nil -} \ No newline at end of file +}