Skip to content

Commit 71e1172

Browse files
author
奇淼(piexlmax
authored
Merge pull request flipped-aurora#896 from 4lkaid/4lkaid_main_develop
fix(utils/file_operations.go): 同名目录存在时正确返回
2 parents a114d29 + 5d62917 commit 71e1172

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

server/utils/file_operations.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ func TrimSpace(target interface{}) {
6969

7070
// FileExist 判断文件是否存在
7171
func FileExist(path string) bool {
72-
_, err := os.Lstat(path)
72+
fi, err := os.Lstat(path)
73+
if err == nil {
74+
return !fi.IsDir()
75+
}
7376
return !os.IsNotExist(err)
7477
}

0 commit comments

Comments
 (0)