diff --git a/containers/tools.go b/containers/tools.go index ceca1df..3b398cf 100644 --- a/containers/tools.go +++ b/containers/tools.go @@ -62,7 +62,7 @@ func du(path string) (int, int, error) { return space, inodes, nil } -// Removes content of given directory +// Removes content of given directory and then the directory itself func removeDirectory(dir string) error { d, err := os.Open(dir) if err != nil { @@ -79,6 +79,12 @@ func removeDirectory(dir string) error { return err } } + + err = os.Remove(filepath.Join(dir)) + if err != nil { + return err + } + return nil }