diff --git a/gitTag.byAge.go b/gitTag.byAge.go index 9d62acf..3341e08 100644 --- a/gitTag.byAge.go +++ b/gitTag.byAge.go @@ -29,3 +29,12 @@ func (a GitTagAge) Less(i, j int) bool { return false } func (a GitTagAge) Swap(i, j int) { a[i], a[j] = a[j], a[i] } + +func (repo *Repo) NewestAge() time.Duration { + all := repo.Tags.SortByAge() + for all.Scan() { + r := all.Next() + return time.Since(r.GetAuthordate().AsTime()) + } + return time.Since(time.Now()) +}