Files

26 lines
471 B
Go

package git
import (
"os"
)
// isDir returns true if given path is a directory, or returns false when it's a
// file or does not exist.
func isDir(dir string) bool {
f, e := os.Stat(dir)
if e != nil {
return false
}
return f.IsDir()
}
// isFile returns true if given path is a file, or returns false when it's a
// directory or does not exist.
func isFile(filePath string) bool {
f, e := os.Stat(filePath)
if e != nil {
return false
}
return !f.IsDir()
}