]> Cypherpunks.ru repositories - gocheese.git/blobdiff - gocheese.go
Constants should be constants
[gocheese.git] / gocheese.go
index 905856df61fc53a15c7bb1993b2b988947909825..432fb6f76e1ca0f1468baa9fea2c97814fe4439a 100644 (file)
@@ -43,6 +43,7 @@ import (
 )
 
 const (
+       Version   = "2.4.1"
        HTMLBegin = `<!DOCTYPE html>
 <html>
   <head>
@@ -68,15 +69,18 @@ You should have received a copy of the GNU General Public License
 along with this program.  If not, see <http://www.gnu.org/licenses/>.`
 )
 
+const (
+       HashAlgoSHA256     = "sha256"
+       HashAlgoBLAKE2b256 = "blake2_256"
+       HashAlgoSHA512     = "sha512"
+       HashAlgoMD5        = "md5"
+)
+
 var (
        pkgPyPI         = regexp.MustCompile(`^.*<a href="([^"]+)"[^>]*>(.+)</a><br/>.*$`)
        normalizationRe = regexp.MustCompilePOSIX("[-_.]+")
 
-       HashAlgoSHA256              = "sha256"
-       HashAlgoBLAKE2b256          = "blake2_256"
-       HashAlgoSHA512              = "sha512"
-       HashAlgoMD5                 = "md5"
-       knownHashAlgos     []string = []string{
+       knownHashAlgos []string = []string{
                HashAlgoSHA256,
                HashAlgoBLAKE2b256,
                HashAlgoSHA512,
@@ -93,12 +97,11 @@ var (
        pypiURL          = flag.String("pypi", "https://pypi.org/simple/", "Upstream PyPI URL")
        passwdPath       = flag.String("passwd", "passwd", "Path to file with authenticators")
        passwdCheck      = flag.Bool("passwd-check", false, "Test the -passwd file for syntax errors and exit")
-       fsck             = flag.Bool("fsck", false, "Check integrity of all packages")
+       fsck             = flag.Bool("fsck", false, "Check integrity of all packages (errors are in stderr)")
        maxClients       = flag.Int("maxclients", 128, "Maximal amount of simultaneous clients")
        version          = flag.Bool("version", false, "Print version information")
        warranty         = flag.Bool("warranty", false, "Print warranty information")
 
-       Version       string = "UNKNOWN"
        killed        bool
        pypiURLParsed *url.URL
 )
@@ -261,7 +264,7 @@ func main() {
                return
        }
        if *version {
-               fmt.Println("GoCheese version " + Version + " built with " + runtime.Version())
+               fmt.Println("GoCheese version", Version, "built with", runtime.Version())
                return
        }
        if *fsck {