Add check for log directory.

This commit is contained in:
Grant Yin
2019-12-18 21:53:13 +08:00
parent edd0a54bad
commit 4669d5dab3
2 changed files with 20 additions and 0 deletions
+14
View File
@@ -0,0 +1,14 @@
package tools
import "os"
func PathExists(path string) (bool, error) {
_, err := os.Stat(path)
if err == nil {
return true, nil
}
if os.IsNotExist(err) {
return false, nil
}
return false, err
}