dir.Exists() method (#564)

This commit is contained in:
Alex Sharov 2022-08-03 15:07:36 +07:00 committed by GitHub
parent 01585ae2a0
commit 0c9ada1ab0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -63,3 +63,11 @@ func MustExist(path string) {
panic(err)
}
}
func Exist(path string) bool {
_, err := os.Stat(path)
if err != nil && os.IsNotExist(err) {
return false
}
return true
}