Simple the result2 to result.

This commit is contained in:
zicla
2019-04-26 03:19:47 +08:00
parent d030a60721
commit c55e8699b4
20 changed files with 204 additions and 204 deletions

View File

@ -9,7 +9,7 @@ import (
"os/user"
"path/filepath"
"strings"
result2 "tank/code/tool/result"
"tank/code/tool/result"
)
//判断文件或文件夹是否已经存在
@ -126,13 +126,13 @@ func GetFilenameOfPath(fullPath string) string {
func DeleteEmptyDir(dirPath string) bool {
dir, err := ioutil.ReadDir(dirPath)
if err != nil {
panic(result2.BadRequest("尝试读取目录%s时出错 %s", dirPath, err.Error()))
panic(result.BadRequest("尝试读取目录%s时出错 %s", dirPath, err.Error()))
}
if len(dir) == 0 {
//空文件夹
err = os.Remove(dirPath)
if err != nil {
panic(result2.BadRequest("删除磁盘上的文件夹%s出错 %s", dirPath, err.Error()))
panic(result.BadRequest("删除磁盘上的文件夹%s出错 %s", dirPath, err.Error()))
}
return true
}