Skip to content

Commit

Permalink
更新
Browse files Browse the repository at this point in the history
  • Loading branch information
deatil committed Mar 3, 2023
1 parent 4279ef2 commit 77b2df7
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions filesystem/filesystem.go
Original file line number Diff line number Diff line change
Expand Up @@ -797,12 +797,11 @@ func LastModified(path string) int64 {
// 是否是文件
func (this *Filesystem) IsFile(path string) bool {
fd, err := os.Stat(path)
if err != nil && os.IsNotExist(err) {
if err != nil {
return false
}

fm := fd.Mode()
return !fm.IsDir()
return !fd.Mode().IsDir()
}

// 是否是文件
Expand All @@ -817,8 +816,7 @@ func (this *Filesystem) IsDirectory(path string) bool {
return false
}

fm := fd.Mode()
return fm.IsDir()
return fd.Mode().IsDir()
}

// 是否为文件夹
Expand Down

0 comments on commit 77b2df7

Please sign in to comment.