diff --git a/gitTag.update.go b/gitTag.update.go index 47afb38..8a7cea0 100644 --- a/gitTag.update.go +++ b/gitTag.update.go @@ -80,3 +80,16 @@ func getGitDateStamp(gitdefault string) time.Time { } return tagTime } + +func (tag *GitTag) GetAge() time.Duration { + return time.Since(tag.GetAuthordate().AsTime()) +} + +func (repo *Repo) NewestTag() *GitTag { + loop := repo.Tags.SortByAge() + for loop.Scan() { + r := loop.Next() + return r + } + return nil +}