Chore: Check errors from Close calls (#29562)

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
This commit is contained in:
Arve Knudsen
2020-12-03 10:11:14 +01:00
committed by GitHub
parent 3c9310e93c
commit f2b7fbc32a
14 changed files with 109 additions and 33 deletions
@@ -153,7 +153,11 @@ func (u *Uploader) uploadFile(
if err != nil {
return err
}
defer fileReader.Close()
defer func() {
if err := fileReader.Close(); err != nil {
u.log.Warn("Failed to close file", "err", err, "path", imageDiskPath)
}
}()
// Set public access if not generating a signed URL
pubAcc := !u.enableSignedURLs