diff options
| author | Jeff Carr <[email protected]> | 2024-12-27 14:40:27 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-12-27 14:40:27 -0600 |
| commit | 4446068e1adf072a90039e5293e31da0d7a9b3a3 (patch) | |
| tree | c1c371faef9c717c8ec8dae2a0383a354b6b12dc | |
| parent | 40830d3f383bd89993dec5edb0e3f7c814e7e71f (diff) | |
need to switch to the slices packagev0.0.42
| -rw-r--r-- | gitTag.byAge.go | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/gitTag.byAge.go b/gitTag.byAge.go index eacf757..8fa52e9 100644 --- a/gitTag.byAge.go +++ b/gitTag.byAge.go @@ -1,13 +1,27 @@ package gitpb -// runs git, parses output -// types faster than you can - import ( "sort" "time" ) +/* +// todo: probably switch to using slices. new things added in 1.23 +// https://pkg.go.dev/slices + +func (all *GitTags) newSort() *GitTagIterator { + slices.SortFunc(all.GitTags, func(a, b *GitTag) int { + if n := strings.Compare(a.Name, b.Name); n != 0 { + return n + } + // If names are equal, order by age + return cmp.Compare(a.Age, b.Age) + }) +} +*/ + +// all this code below is junk and seamingly wrong + func (all *GitTags) SortByAge() *GitTagIterator { packs := all.selectAllGitTag() |
