mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-14 14:25:36 +01:00
fix: close file (#20189)
Signed-off-by: guoguangwu <guoguangwug@gmail.com> Co-authored-by: Wang Yan <wangyan@vmware.com>
This commit is contained in:
parent
cea47c7db3
commit
9778176ff1
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user