Documentation ¶
Index ¶
- func Dir(dst string, sources ...string) (bool, error)
- func DirNewer(target time.Time, sources ...string) (bool, error)
- func Glob(dst string, globs ...string) (bool, error)
- func GlobNewer(target time.Time, sources ...string) (bool, error)
- func NewestModTime(targets ...string) (time.Time, error)
- func OldestModTime(targets ...string) (time.Time, error)
- func Path(dst string, sources ...string) (bool, error)
- func PathNewer(target time.Time, sources ...string) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Dir ¶
Dir reports whether any of the sources have been modified more recently than the destination. If a source or destination is a directory, this function returns true if a source has any file that has been modified more recently than the most recently modified file in dst. If the destination file doesn't exist, it always returns true and nil. It's an error if any of the sources don't exist.
func DirNewer ¶ added in v1.11.0
DirNewer reports whether any item in sources is newer than the target time. Sources are searched recursively and searching stops as soon as any entry is newer than the target.
func Glob ¶ added in v1.9.0
Glob expands each of the globs (file patterns) into individual sources and then calls Path on the result, reporting if any of the resulting sources have been modified more recently than the destination. Syntax for Glob patterns is the same as stdlib's filepath.Glob. Note that Glob does not expand environment variables before globbing -- env var expansion happens during the call to Path. It is an error for any glob to return an empty result.
func GlobNewer ¶ added in v1.11.0
GlobNewer performs glob expansion on each source and passes the results to PathNewer for inspection. It returns the first time PathNewer encounters a newer file
func NewestModTime ¶ added in v1.11.0
NewestModTime recurses a list of target filesystem objects and finds the the newest ModTime among them.
func OldestModTime ¶ added in v1.11.0
OldestModTime recurses a list of target filesystem objects and finds the the oldest ModTime among them.
func Path ¶
Path first expands environment variables like $FOO or ${FOO}, and then reports if any of the sources have been modified more recently than the destination. Path does not descend into directories, it literally just checks the modtime of each thing you pass to it. If the destination file doesn't exist, it always returns true and nil. It's an error if any of the sources don't exist.
Types ¶
This section is empty.