feat: delete file if download fails

This commit is contained in:
Mathis Maquenne
2025-04-26 13:17:03 +02:00
parent f931cad746
commit 6d3935c744
2 changed files with 16 additions and 0 deletions
+8
View File
@@ -7,3 +7,11 @@ func FileExists(path string) bool {
return err == nil && !info.IsDir()
}
func DeleteFile(path string) error {
if !FileExists(path) {
return nil
}
return os.Remove(path)
}