trace
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user