21 lines
325 B
Go
21 lines
325 B
Go
package internal
|
|
|
|
import "os"
|
|
|
|
const (
|
|
BackupPath = "backup"
|
|
TimeFormat = "20060102150405"
|
|
FilePathFormat = "%s/%s_%s_%09d_%04d.dat"
|
|
)
|
|
|
|
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
|
|
}
|