Remove unused function in download package

This commit is contained in:
NeilClack
2026-06-27 14:25:51 -05:00
parent 2c88b7ffc5
commit 0b43a98298
-19
View File
@@ -237,22 +237,3 @@ func downloadFile(url, destPath string, onChunk func(int64)) (int64, error) {
return total, nil
}
// ensureDir creates path and all parents if they don't exist.
func ensureDir(path string) error {
info, err := os.Stat(path)
if err == nil {
if !info.IsDir() {
return fmt.Errorf("path exists but is not a directory: %s", path)
}
return nil
}
if !os.IsNotExist(err) {
return fmt.Errorf("stat %s: %w", path, err)
}
if err := os.MkdirAll(path, 0o750); err != nil {
return fmt.Errorf("mkdir %s: %w", path, err)
}
logger.Info("download: created directory %s", path)
return nil
}