Skip to content

Commit

Permalink
fix: close file (#20189)
Browse files Browse the repository at this point in the history
Signed-off-by: guoguangwu <[email protected]>
Co-authored-by: Wang Yan <[email protected]>
  • Loading branch information
testwill and wy65701436 authored Apr 3, 2024
1 parent cea47c7 commit 9778176
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/pkg/scan/export/digest_calculator.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9778176

Please sign in to comment.