Check err and correctly close file for S3 storage

Signed-off-by: Mustafa Gezen <mustafa@ctrliq.com>
This commit is contained in:
Mustafa Gezen 2022-08-16 14:25:55 +02:00
parent 4016569ce1
commit 302c68a383
Signed by untrusted user who does not match committer: mustafa
GPG Key ID: DCDF010D946438C1
1 changed files with 2 additions and 1 deletions

View File

@ -96,6 +96,7 @@ func (s *Storage) DownloadObject(objectName string, path string) error {
if err != nil {
return err
}
defer f.Close()
_, err = s.downloader.Download(
f,
@ -105,7 +106,7 @@ func (s *Storage) DownloadObject(objectName string, path string) error {
},
)
return nil
return err
}
func (s *Storage) ReadObject(objectName string) ([]byte, error) {