Skip to content

Add "setof" helpers - #408

Merged
klauspost merged 1 commit into
tinylib:masterfrom
klauspost:setof-improve
Aug 29, 2025
Merged

klauspost merged 1 commit into
tinylib:masterfrom
klauspost:setof-improve

Conversation

@klauspost

Copy link
Copy Markdown
Collaborator
  • Add FooFromSlice that will convert a slice of type to map[foo]struct{}
  • Add Foo.AsSlice that will return the set as a slice (sorted on sorted types).
  • Use clear to clear maps (Go 1.21)

We can't use fancy maps and slices methods yet, since that is Go 1.23.

* Add `FooFromSlice` that will convert a slice of type to map[foo]struct{}
* Add `Foo.AsSlice` that will return the set as a slice (sorted on sorted types).
* Use `clear` to clear maps (Go 1.21)

We can't use fancy `maps` and `slices` methods yet, since that is Go 1.23.
@klauspost
klauspost merged commit 5817f93 into tinylib:master Aug 29, 2025
4 checks passed
@klauspost
klauspost deleted the setof-improve branch August 29, 2025 17:51
gannett-ggreer pushed a commit to GannettDigital/msgp that referenced this pull request Aug 25, 2026
* Add `FooFromSlice` that will convert a slice of type to map[foo]struct{}
* Add `Foo.AsSlice` that will return the set as a slice (sorted on sorted types).
* Use `clear` to clear maps (Go 1.21)

We can't use fancy `maps` and `slices` methods yet, since that is Go 1.23.
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.

2 participants