mirror of
https://github.com/turbot/steampipe.git
synced 2026-02-17 10:00:17 -05:00
21 lines
310 B
Go
21 lines
310 B
Go
package utils
|
|
|
|
import (
|
|
"os"
|
|
"path/filepath"
|
|
)
|
|
|
|
func RemoveDirectoryContents(removePath string) error {
|
|
files, err := filepath.Glob(filepath.Join(removePath, "*"))
|
|
if err != nil {
|
|
return err
|
|
}
|
|
for _, file := range files {
|
|
err = os.RemoveAll(file)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
}
|
|
return nil
|
|
}
|