]> Cypherpunks.ru repositories - gocheese.git/blobdiff - list.go
Use an updated recfile library
[gocheese.git] / list.go
diff --git a/list.go b/list.go
index 356cd6bf01874f5aaf687028d3dfd556dc56db76..8567877d336b49a3c51ffceb63ef942399d086da 100644 (file)
--- a/list.go
+++ b/list.go
@@ -25,7 +25,6 @@ import (
        "fmt"
        "html/template"
        "io/fs"
-       "io/ioutil"
        "log"
        "net/http"
        "os"
@@ -50,7 +49,7 @@ var (
 )
 
 func listRoot(w http.ResponseWriter, r *http.Request) {
-       files, err := ioutil.ReadDir(Root)
+       files, err := os.ReadDir(Root)
        if err != nil {
                log.Println("error", r.RemoteAddr, "root", err)
                http.Error(w, err.Error(), http.StatusInternalServerError)
@@ -147,7 +146,7 @@ func listDir(pkgName string, doSize bool) (int64, []*PkgReleaseInfo, error) {
                                continue
                        }
                        delete(files, fn)
-                       digest, err := ioutil.ReadFile(filepath.Join(dirPath, fn))
+                       digest, err := os.ReadFile(filepath.Join(dirPath, fn))
                        if err != nil {
                                return 0, nil, err
                        }