move Place

This commit is contained in:
away
2021-05-26 19:57:47 +08:00
parent cf82b4fc6f
commit e93e4f5e52
10 changed files with 0 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
package utils
import "os"
// Determine whether the given path is a folder
func IsDir(path string) bool {
s, err := os.Stat(path)
if err != nil {
return false
}
return s.IsDir()
}
// Determine whether the given path is a file
func IsFile(path string) bool {
return !IsDir(path)
}
// Create a directory
func MkDir(path string) error {
return os.MkdirAll(path, os.ModePerm)
}