No Description
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.

fs.go 362B

1234567891011121314151617181920212223
  1. package fs
  2. import "os"
  3. // Exists returns if a file exists
  4. func Exists(path string) bool {
  5. if _, err := os.Stat(path); os.IsNotExist(err) {
  6. return false
  7. }
  8. return true
  9. }
  10. // IsDir returns if path is a directory
  11. func IsDir(path string) bool {
  12. info, err := os.Stat(path)
  13. if err != nil {
  14. return false
  15. }
  16. if info.IsDir() {
  17. return true
  18. }
  19. return false
  20. }