remove unused functions

This commit is contained in:
Bala.FA
2016-02-10 20:05:46 +05:30
committed by Harshavardhana
parent 255505a83b
commit 5e4b13f4bd
3 changed files with 13 additions and 87 deletions
+10 -8
View File
@@ -25,15 +25,17 @@ import (
)
// IsDirEmpty Check if a directory is empty
func IsDirEmpty(dirname string) (bool, error) {
names, err := ReadDirNamesN(dirname, 1)
if err != nil && err != io.EOF {
return false, err
func IsDirEmpty(dirname string) (status bool, err error) {
f, err := os.Open(dirname)
if err == nil {
defer f.Close()
if _, err = f.Readdirnames(1); err == io.EOF {
status = true
err = nil
}
}
if len(names) > 0 {
return false, nil
}
return true, nil
return
}
// FTW walks the file tree rooted at root, calling walkFn for each file or