remove redudant call in filesys RemoveDir
This commit is contained in:
parent
33c1d9e663
commit
ec4bf00276
1 changed files with 1 additions and 11 deletions
|
|
@ -59,20 +59,10 @@ func EnsureDirPathExist(dirPath string) error {
|
|||
|
||||
// RemoveDir deletes everything at folder dir.
|
||||
func RemoveDir(dir string) error {
|
||||
exist, err := DirExists(dir)
|
||||
|
||||
if err != nil {
|
||||
if err := os.RemoveAll(dir); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if exist {
|
||||
err := os.RemoveAll(dir)
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue