internal/download: improve

This commit is contained in:
Felix Lange 2025-05-14 11:21:41 +02:00
parent 47193f6459
commit a6baf48021

View file

@ -156,6 +156,7 @@ func (db *ChecksumDB) VerifyAll() {
} }
} }
// verifyHash checks that the file at 'path' has the expected hash.
func verifyHash(path, expectedHash string) error { func verifyHash(path, expectedHash string) error {
fd, err := os.Open(path) fd, err := os.Open(path)
if err != nil { if err != nil {
@ -172,7 +173,6 @@ func verifyHash(path, expectedHash string) error {
return fmt.Errorf("invalid file hash: %s %s", fileHash, filepath.Base(path)) return fmt.Errorf("invalid file hash: %s %s", fileHash, filepath.Base(path))
} }
return nil return nil
} }
// DownloadFileFromKnownURL downloads a file from the URL defined in the checksum database. // DownloadFileFromKnownURL downloads a file from the URL defined in the checksum database.