mirror of
https://github.com/aykhans/movier.git
synced 2025-04-17 04:13:12 +00:00
17 lines
297 B
Go
17 lines
297 B
Go
package utils
|
|
|
|
import "os"
|
|
|
|
func MakeDirIfNotExist(path string) error {
|
|
return os.MkdirAll(path, os.ModePerm)
|
|
}
|
|
|
|
func IsDirExist(path string) (bool, error) {
|
|
if _, err := os.Stat(path); err == nil {
|
|
return true, nil
|
|
} else if !os.IsNotExist(err) {
|
|
return false, err
|
|
}
|
|
return false, nil
|
|
}
|