You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

23 lines
362 B

package fs
import "os"
// Exists returns if a file exists
func Exists(path string) bool {
if _, err := os.Stat(path); os.IsNotExist(err) {
return false
}
return true
}
// IsDir returns if path is a directory
func IsDir(path string) bool {
info, err := os.Stat(path)
if err != nil {
return false
}
if info.IsDir() {
return true
}
return false
}