aboutsummaryrefslogtreecommitdiff
path: root/internal/handlers
diff options
context:
space:
mode:
authorRaúl Benencia <id@rbenencia.name>2026-06-05 17:02:09 -0300
committerRaul Benencia <46945030+raul-te@users.noreply.github.com>2026-06-05 17:07:52 -0300
commit17b1e22a87f8fbdf90b052070fbf704a6729ed60 (patch)
treec144a9500f3557ce045551aef9eb6f97117dc3d2 /internal/handlers
parent07a844375e9052b998f425fbe65094bc555974ba (diff)
Replace io/ioutil with os equivalents
ioutil.ReadFile and ioutil.ReadDir have been deprecated since Go 1.16.
Diffstat (limited to 'internal/handlers')
-rw-r--r--internal/handlers/static.go7
1 files changed, 3 insertions, 4 deletions
diff --git a/internal/handlers/static.go b/internal/handlers/static.go
index b27fa1a..ebec994 100644
--- a/internal/handlers/static.go
+++ b/internal/handlers/static.go
@@ -16,7 +16,6 @@ package handlers
import (
"fmt"
- "io/ioutil"
"net/http"
"os"
"path"
@@ -76,17 +75,17 @@ func (o *OverlayFileServerHandler) ServeHTTP(w http.ResponseWriter, r *http.Requ
}
isDir := false
- fileList := make(map[string]os.FileInfo)
+ fileList := make(map[string]os.DirEntry)
if errUpper == nil && infoUpper.IsDir() {
- files, _ := ioutil.ReadDir(upper)
+ files, _ := os.ReadDir(upper)
for _, f := range files {
fileList[f.Name()] = f
}
isDir = true
}
if errLower == nil && infoLower.IsDir() {
- files, _ := ioutil.ReadDir(lower)
+ files, _ := os.ReadDir(lower)
for _, f := range files {
if _, ok := fileList[f.Name()]; !ok {
fileList[f.Name()] = f
nihil fit ex nihilo