Fix some copy warning.

This commit is contained in:
zicla
2020-03-12 00:56:54 +08:00
parent fc2df7e501
commit bea9a0a56d
4 changed files with 28 additions and 3 deletions

View File

@ -128,7 +128,11 @@ func GetFilenameOfPath(fullPath string) string {
func DeleteEmptyDir(dirPath string) bool {
dir, err := ioutil.ReadDir(dirPath)
if err != nil {
panic(result.BadRequest("occur error while reading %s %s", dirPath, err.Error()))
if strings.Contains(err.Error(), "The system cannot find") {
return false
} else {
panic(result.BadRequest("occur error while reading %s %s", dirPath, err.Error()))
}
}
if len(dir) == 0 {
//empty dir