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()