shortcut to get the age of a repo
This commit is contained in:
parent
1e4b0c0d37
commit
5341a70557
|
@ -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())
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue