This commit is contained in:
simonzhangsz committed 2023-08-31 17:35:43 +08:00
1 parent 4adba55e88
commit c0c4d333da
2 files changed
+30 -6

No files matched your search

+12
View File
@@ -354,6 +354,18 @@ func PathExists(path string) (bool, error) {
return false, err
}
// PathExists check path is exist or no
func FilePathExists(filePath string) (bool, error) {
_, err := os.Stat(filePath)
if err == nil { //文件或者目录存在
return true, nil
}
if os.IsNotExist(err) {
return false, nil
}
return false, err
}
func GetDayDuration(d1, d2 string) int64 {
a, _ := time.Parse("2006-01-02", d1)
b, _ := time.Parse("2006-01-02", d2)