mirror of
https://github.com/goharbor/harbor.git
synced 2024-09-26 04:23:22 +02:00
fix: close file (#20220)
Signed-off-by: Shengwen Yu <yshengwen@vmware.com>
This commit is contained in:
parent
1d2f3d43f2
commit
a7f62f3cff
@ -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