From a551072e327d6e9126ce1db6dbbcb26f32514d25 Mon Sep 17 00:00:00 2001
From: Hydraallen <wangruiallen@gmail.com>
Date: Tue, 10 Sep 2024 19:08:09 +0800
Subject: [PATCH] fix: verify

---
 pkg/healthcheck/verify.go | 19 +++----------------
 1 file changed, 3 insertions(+), 16 deletions(-)

diff --git a/pkg/healthcheck/verify.go b/pkg/healthcheck/verify.go
index 3372712..e983170 100644
--- a/pkg/healthcheck/verify.go
+++ b/pkg/healthcheck/verify.go
@@ -37,33 +37,20 @@ func checkFileChecksum(rootDir, fileName, expectedChecksum string) (bool, string
 	}
 
 	if actualChecksum == expectedChecksum {
-		return true, "" // fmt.Sprintf("Checksum for %s passed!", filePath)
+		return true, ""
 	} else {
 		return false, fmt.Sprintf("Checksum for %s failed. Expected %s, but got %s. Please revert your changes or contact the teaching team if you have a valid reason for adjusting them.", filePath, expectedChecksum, actualChecksum)
 	}
 }
 
 func VerifyFiles(rootDir string, checkFileNameList string, checkFileSumList string) error {
-	// Parse command-line arguments
-	// checkFileNameList := flag.String("checkFileNameList", "", "Comma-separated list of files to check.")
-	// checkFileSumList := flag.String("checkFileSumList", "", "Comma-separated list of expected checksums.")
-	// rootDir := flag.String("rootDir", ".", "Root directory containing the files.")
-	// flag.Parse()
-	// Process input file names and checksums
 	if len(checkFileNameList) == 0 {
-		return nil // fmt.Errorf("No checksum happened")
+		return nil
 		os.Exit(1)
 	}
 	fileNames := strings.Split(checkFileNameList, ",")
 	checkSums := strings.Split(checkFileSumList, ",")
 
-	// Check if the number of files matches the number of checksums
-
-	if len(fileNames) != len(checkSums) {
-		return fmt.Errorf("Error: The number of files and checksums do not match.")
-		os.Exit(1)
-	}
-
 	allPassed := true
 	var errorMessages []string
 
@@ -80,7 +67,7 @@ func VerifyFiles(rootDir string, checkFileNameList string, checkFileSumList stri
 		}
 	}
 	if allPassed {
-		return nil // fmt.Errorf("Congratulations! All checksums passed!")
+		return nil
 	} else {
 		return fmt.Errorf("Some checksums failed. Please review the errors below:")
 		for _, msg := range errorMessages {