From 1a21eca3a2db517830d78cc1c64be81158d57a24 Mon Sep 17 00:00:00 2001 From: Draylar Date: Mon, 19 Oct 2020 17:29:54 -0500 Subject: [PATCH] Remove special casing for casing differences, clarify error message --- core/mod.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/core/mod.go b/core/mod.go index d60f260..38e9b4f 100644 --- a/core/mod.go +++ b/core/mod.go @@ -9,7 +9,6 @@ import ( "path/filepath" "strconv" "fmt" - "strings" "github.com/BurntSushi/toml" ) @@ -150,11 +149,8 @@ func (m Mod) DownloadFile(dest io.Writer) error { calculatedHash := hex.EncodeToString(h.Sum(nil)) // Check if the hash of the downloaded file matches the expected hash. - // Also check if the uppercase version of the expected hash matches. - if(strings.ToUpper(calculatedHash) != m.Download.Hash) { - return errors.New(fmt.Sprintf("Hash of saved file %s only matches when uppercased. Consider changing this to prevent future issues.\n", m.GetFilePath())) - } else if calculatedHash != m.Download.Hash { - return errors.New(fmt.Sprintf("hash of saved file is invalid!\n .toml hash: %s\n download hash: %s\n", calculatedHash, m.Download.Hash)) + if calculatedHash != m.Download.Hash { + return errors.New(fmt.Sprintf("Hash of downloaded file does no match with expected hash!\n download hash: %s\n expected hash: %s\n", calculatedHash, m.Download.Hash)) } return nil