diff options
Diffstat (limited to 'gitTag.update.go')
| -rw-r--r-- | gitTag.update.go | 13 |
1 files changed, 13 insertions, 0 deletions
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 +} |
