From 48ab754ddf2275bb7d356f3b3dfa9ff97396f166 Mon Sep 17 00:00:00 2001 From: Hydraallen Date: Mon, 26 Aug 2024 20:12:20 +0800 Subject: [PATCH] fix: verify --- pkg/healthcheck/verify.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pkg/healthcheck/verify.go b/pkg/healthcheck/verify.go index 31dd6c6..d8076bf 100644 --- a/pkg/healthcheck/verify.go +++ b/pkg/healthcheck/verify.go @@ -50,13 +50,15 @@ func VerifyFiles(rootDir string,checkFileNameList string, checkFileSumList strin // 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") + 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) == 0 { - return nil//fmt.Errorf("No checksum happened") - } + if len(fileNames) != len(checkSums) { return fmt.Errorf("Error: The number of files and checksums do not match.")