]> Cypherpunks.ru repositories - gocheese.git/blobdiff - list.go
Refactor -help, remove -root
[gocheese.git] / list.go
diff --git a/list.go b/list.go
index d8bd0732459d04fc805e1f6562418d71dae4c00b..48a9d71498fc7cbaebe315bd76cba7d76b1871d2 100644 (file)
--- a/list.go
+++ b/list.go
@@ -66,7 +66,7 @@ var (
 )
 
 func listRoot(w http.ResponseWriter, r *http.Request) {
-       files, err := ioutil.ReadDir(*Root)
+       files, err := ioutil.ReadDir(Root)
        if err != nil {
                log.Println("error", r.RemoteAddr, "root", err)
                http.Error(w, err.Error(), http.StatusInternalServerError)
@@ -138,7 +138,7 @@ func filenameToVersion(fn string) string {
 }
 
 func listDir(pkgName string, doSize bool) (int, []*PkgReleaseInfo, error) {
-       dirPath := filepath.Join(*Root, pkgName)
+       dirPath := filepath.Join(Root, pkgName)
        entries, err := os.ReadDir(dirPath)
        if err != nil {
                return 0, nil, err
@@ -215,7 +215,7 @@ func serveListDir(
        pkgName string,
        autorefresh, gpgUpdate bool,
 ) {
-       dirPath := filepath.Join(*Root, pkgName)
+       dirPath := filepath.Join(Root, pkgName)
        if autorefresh {
                if !refreshDir(w, r, pkgName, "", gpgUpdate) {
                        return