diff options
| author | Jeff Carr <[email protected]> | 2024-12-03 03:19:22 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-12-03 03:19:22 -0600 |
| commit | aec1833fe69af27dc5a77f652b1a02af3097d9e9 (patch) | |
| tree | 5702d1b6035f0dcc61e2b123300107673bdae489 /gitTag.update.go | |
| parent | 33880f9006397c7a90977de42ea26034f9faee78 (diff) | |
might be right?v0.0.20
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 +} |
