X-Git-Url: http://www.git.cypherpunks.ru/?a=blobdiff_plain;f=integrity.go;h=1e0dddde15c86657d48e26d5f3e9aa928765b851;hb=60834a0713d5dcc6a9911511cb8618ce7358c824;hp=f6f39e6d5749baff977e93cfa5460cb7c4be7ec3;hpb=d9767ae738045ebf1bd483ae708af80fa384ca9f;p=gocheese.git diff --git a/integrity.go b/integrity.go index f6f39e6..1e0dddd 100644 --- a/integrity.go +++ b/integrity.go @@ -1,6 +1,6 @@ /* GoCheese -- Python private package repository and caching proxy -Copyright (C) 2019-2020 Sergey Matveev +Copyright (C) 2019-2021 Sergey Matveev 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 @@ -29,7 +29,7 @@ import ( ) func goodIntegrity() bool { - dirs, err := ioutil.ReadDir(*root) + dirs, err := ioutil.ReadDir(*Root) if err != nil { log.Fatal(err) } @@ -39,7 +39,7 @@ func goodIntegrity() bool { var data []byte var pkgName string for _, dir := range dirs { - files, err := ioutil.ReadDir(filepath.Join(*root, dir.Name())) + files, err := ioutil.ReadDir(filepath.Join(*Root, dir.Name())) if err != nil { log.Fatal(err) } @@ -48,7 +48,7 @@ func goodIntegrity() bool { continue } pkgName = strings.TrimSuffix(file.Name(), "."+HashAlgoSHA256) - data, err = ioutil.ReadFile(filepath.Join(*root, dir.Name(), pkgName)) + data, err = ioutil.ReadFile(filepath.Join(*Root, dir.Name(), pkgName)) if err != nil { if os.IsNotExist(err) { continue @@ -56,7 +56,7 @@ func goodIntegrity() bool { log.Fatal(err) } hasher.Write(data) - data, err = ioutil.ReadFile(filepath.Join(*root, dir.Name(), file.Name())) + data, err = ioutil.ReadFile(filepath.Join(*Root, dir.Name(), file.Name())) if err != nil { log.Fatal(err) }