Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Sorted method #127

Merged
merged 4 commits into from
Nov 29, 2023
Merged

Add Sorted method #127

merged 4 commits into from
Nov 29, 2023

Conversation

Frassle
Copy link
Contributor

@Frassle Frassle commented Sep 16, 2023

This is a set variant on slices.Sort that makes it easy to get a sorted slice. This makes it easy to get the elements of the set into a sorted slice. Quite handy when using sets to build up unique elements but then needing a well defined iteration order.

This is a varient on `slices.Sorted` that makes it easy to get a sorted slice. This makes it easy to get the elements of the set into a sorted slice. Quite handy when using sets to build up unique elements but then needing a well defined iteration order.
@Frassle
Copy link
Contributor Author

Frassle commented Sep 16, 2023

A helpful wrapper around https://pkg.go.dev/[email protected]#Sort. I could add SortedFunc as well if wanted to wrap https://pkg.go.dev/[email protected]#SortFunc.

@deckarep
Copy link
Owner

@Frassle - thanks for your contribution. This seems like a nice and convenient helper func. I’ll look it over in detail along with your other posted issue likely tomorrow.

Thanks for your interest and contribution!

@Frassle
Copy link
Contributor Author

Frassle commented Sep 17, 2023

Noticed from your CI run that "slices" and "cmp" are only in go 1.21 so I've moved this to a new file that can be conditional by version. Won't break existing users, but anyone wanting to use sorted will need to be on 1.21.

@Frassle
Copy link
Contributor Author

Frassle commented Nov 22, 2023

Hey @deckarep just to check in if you've had a chance to consider this yet?

@deckarep deckarep merged commit 5ff637d into deckarep:main Nov 29, 2023
6 checks passed
@deckarep
Copy link
Owner

Thanks @Frassle for this change. Sorry I never got around to it but it looks good. Thanks @funwithbots for the pair of eyes.

This will show up in release: v2.5.0

@Frassle
Copy link
Contributor Author

Frassle commented Nov 29, 2023

Thanks! And no worries about the time, I know how easy it is to lose track of things like this.

@Frassle Frassle deleted the sorted branch November 29, 2023 22:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants