From ac583504e57ce2edca74c6d33008b0d1fe161d4a Mon Sep 17 00:00:00 2001 From: zzjc1234 <2359047351@qq.com> Date: Sat, 31 Aug 2024 11:43:55 +0800 Subject: [PATCH] fix: rm debug code --- pkg/healthcheck/verify.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/pkg/healthcheck/verify.go b/pkg/healthcheck/verify.go index d8076bf..3372712 100644 --- a/pkg/healthcheck/verify.go +++ b/pkg/healthcheck/verify.go @@ -37,13 +37,13 @@ func checkFileChecksum(rootDir, fileName, expectedChecksum string) (bool, string } if actualChecksum == expectedChecksum { - return true, ""//fmt.Sprintf("Checksum for %s passed!", filePath) + return true, "" // fmt.Sprintf("Checksum for %s passed!", filePath) } 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 { +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.") @@ -51,7 +51,7 @@ func VerifyFiles(rootDir string,checkFileNameList string, checkFileSumList strin // flag.Parse() // Process input file names and checksums if len(checkFileNameList) == 0 { - return nil//fmt.Errorf("No checksum happened") + return nil // fmt.Errorf("No checksum happened") os.Exit(1) } fileNames := strings.Split(checkFileNameList, ",") @@ -59,7 +59,6 @@ func VerifyFiles(rootDir string,checkFileNameList string, checkFileSumList strin // 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) @@ -80,9 +79,8 @@ func VerifyFiles(rootDir string,checkFileNameList string, checkFileSumList strin errorMessages = append(errorMessages, message) } } - fmt.Printf("test") if allPassed { - return nil//fmt.Errorf("Congratulations! All checksums passed!") + return nil // fmt.Errorf("Congratulations! All checksums passed!") } else { return fmt.Errorf("Some checksums failed. Please review the errors below:") for _, msg := range errorMessages {