mirror of
https://github.com/mikefarah/yq.git
synced 2026-09-05 17:36:59 +08:00
Fix for gosec rule G104 - handle errors
This commit is contained in:
committed by
Mike Farah
parent
6658a93e7d
commit
f67a83a5bc
@@ -54,6 +54,9 @@ func (w *writeInPlaceHandlerImpl) FinishWriteInPlace(evaluatedSuccessfully bool)
|
||||
safelyRenameFile(w.tempFile.Name(), w.inputFilename)
|
||||
} else {
|
||||
log.Debug("removed temp file")
|
||||
os.Remove(w.tempFile.Name())
|
||||
removeErr := os.Remove(w.tempFile.Name())
|
||||
if removeErr != nil {
|
||||
log.Errorf("failed removing temp file: %s", w.tempFile.Name())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user