From 3020e814c1e4e23baf281f4ff7a1121dd54f8fe3 Mon Sep 17 00:00:00 2001 From: Sergey Matveev Date: Sat, 7 Nov 2020 17:04:43 +0300 Subject: [PATCH] Constants should be constants --- gocheese.go | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/gocheese.go b/gocheese.go index fa12d18..432fb6f 100644 --- a/gocheese.go +++ b/gocheese.go @@ -69,15 +69,18 @@ You should have received a copy of the GNU General Public License along with this program. If not, see .` ) +const ( + HashAlgoSHA256 = "sha256" + HashAlgoBLAKE2b256 = "blake2_256" + HashAlgoSHA512 = "sha512" + HashAlgoMD5 = "md5" +) + var ( pkgPyPI = regexp.MustCompile(`^.*]*>(.+)
.*$`) normalizationRe = regexp.MustCompilePOSIX("[-_.]+") - HashAlgoSHA256 = "sha256" - HashAlgoBLAKE2b256 = "blake2_256" - HashAlgoSHA512 = "sha512" - HashAlgoMD5 = "md5" - knownHashAlgos []string = []string{ + knownHashAlgos []string = []string{ HashAlgoSHA256, HashAlgoBLAKE2b256, HashAlgoSHA512, @@ -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 { -- 2.44.0