mirror of
https://github.com/rocky-linux/peridot.git
synced 2024-12-18 17:08:29 +00:00
Check err and correctly close file for S3 storage
Signed-off-by: Mustafa Gezen <mustafa@ctrliq.com>
This commit is contained in:
parent
4016569ce1
commit
302c68a383
@ -96,6 +96,7 @@ func (s *Storage) DownloadObject(objectName string, path string) error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
defer f.Close()
|
||||||
|
|
||||||
_, err = s.downloader.Download(
|
_, err = s.downloader.Download(
|
||||||
f,
|
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) {
|
func (s *Storage) ReadObject(objectName string) ([]byte, error) {
|
||||||
|
Loading…
Reference in New Issue
Block a user