Minor fixups around non existent files for timestamps

This commit is contained in:
Gregory Kurtzer
2020-11-01 22:06:03 -08:00
parent f503d04677
commit 3ecd1056bc
2 changed files with 18 additions and 9 deletions

View File

@@ -12,7 +12,7 @@ import (
)
func DirModTime (path string) time.Time {
func DirModTime (path string) (time.Time, error) {
var lastTime time.Time
err := filepath.Walk(path, func(path string, info os.FileInfo, err error) error {
@@ -28,9 +28,9 @@ func DirModTime (path string) time.Time {
return nil
})
if err != nil {
return time.Now()
return time.Time{}, err
}
return lastTime
return lastTime, nil
}
func RandomString(n int) string {