Fix some copy warning.

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

No files matched your search

+5 -1
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