]> 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 f38eab35f83b2f1d8bfde9a995ba1aa313a70bce..8567877d336b49a3c51ffceb63ef942399d086da 100644 (file)
--- a/list.go
+++ b/list.go
@@ -1,6 +1,6 @@
 /*
 GoCheese -- Python private package repository and caching proxy
-Copyright (C) 2019-2021 Sergey Matveev <stargrave@stargrave.org>
+Copyright (C) 2019-2022 Sergey Matveev <stargrave@stargrave.org>
 
 This program is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
@@ -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
                        }