Add funcs ReadDir, Exists.
This commit is contained in:
parent
6bc30e63f0
commit
6b15e0f4ae
@ -33,3 +33,13 @@ func ReadDir(dirData string) ([]os.DirEntry, error) {
|
|||||||
|
|
||||||
return files, nil
|
return files, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Exists check if the file or directory exists.
|
||||||
|
func Exists(path string) bool {
|
||||||
|
_, err := os.Stat(path)
|
||||||
|
if err == nil {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user