fix: close file

Signed-off-by: guoguangwu <guoguangwug@gmail.com>
This commit is contained in:
guoguangwu 2024-03-29 16:34:24 +08:00 committed by guangwu
parent 7c2158bdf9
commit 88f2e43b8c
1 changed files with 1 additions and 0 deletions

View File

@ -35,6 +35,7 @@ func (calc *SHA256ArtifactDigestCalculator) Calculate(fileName string) (digest.D
if err != nil {
return "", err
}
defer file.Close()
hash := sha256.New()
if _, err := io.Copy(hash, file); err != nil {
return "", err