mtimeOf returns the file modification time at path, or the zero value if path doesn't exist or can't be stat'd. The zero value (time.Time{}) is a sentinel meaning "file not found" and is safe to compare via [time.Time.Equal] in [Cache.maybeReload]: it will never equal a real mtime, so the reload wi
(path string)
| 282 | // and is safe to compare via [time.Time.Equal] in [Cache.maybeReload]: it |
| 283 | // will never equal a real mtime, so the reload will proceed as expected. |
| 284 | func mtimeOf(path string) time.Time { |
| 285 | if info, err := os.Stat(path); err == nil { |
| 286 | return info.ModTime() |
| 287 | } |
| 288 | return time.Time{} |
| 289 | } |
| 290 | |
| 291 | // lockFile takes an exclusive advisory lock on "<path>.lock", creating |
| 292 | // the lock file (and any missing parent directory) if needed. The |
no outgoing calls
no test coverage detected