Skip to content

Commit

Permalink
Adding IsDir function
Browse files Browse the repository at this point in the history
  • Loading branch information
LandonTClipp committed Jul 17, 2020
1 parent 1092248 commit d18b044
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions path.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,12 @@ func (p *Path) IsDir() (bool, error) {
return afero.IsDir(p.Fs(), p.Path())
}

// IsDir returns whether or not the os.FileInfo object represents a
// directory.
func IsDir(fileInfo os.FileInfo) bool {
return fileInfo.IsDir()
}

// IsEmpty checks if a given file or directory is empty.
func (p *Path) IsEmpty() (bool, error) {
return afero.IsEmpty(p.Fs(), p.Path())
Expand Down

0 comments on commit d18b044

Please sign in to comment.