first commit
This commit is contained in:
20
internal/pkg/file/file.go
Normal file
20
internal/pkg/file/file.go
Normal file
@@ -0,0 +1,20 @@
|
||||
package file
|
||||
|
||||
import "os"
|
||||
|
||||
func Exists(path string) (bool, error) {
|
||||
_, err := os.Stat(path)
|
||||
if err == nil {
|
||||
return true, nil
|
||||
}
|
||||
|
||||
if os.IsNotExist(err) {
|
||||
return false, nil
|
||||
}
|
||||
|
||||
return false, err
|
||||
}
|
||||
|
||||
func Mkdir(path string) error {
|
||||
return os.MkdirAll(path, os.ModePerm)
|
||||
}
|
||||
Reference in New Issue
Block a user