Add go1.23 iterator support #160
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Alternative to #140. provides a method on the Set[T], named
Elements
that returns an iter.Seq[T].Also adds support for constructing a set from iter.Seq or iter.Seq2 (keys or values).
For go1.22 and below provide the same function with docs but panics if the function is called (noted in the docs).
For go1.23+ add deprecation notice to the old iterator functions.
I used the locally preferred name of
Elements
based on the convo in #140 & #141, but based on:Values
All
instead.Let me know if I should make a change.
Also, let me know if you want me to move the method off the type to a package function like in #140 .
Also updated the test matrix to support the latest go 1.21, 1.22, 1.23, and 1.24 releases.
This was done this way to provide the most seamless path I could think of atm and still be a method of the type.
Once support for version of go < 1.23 are dropped the additional files can be dropped and the contents integrated back into their respective locations.
As an alternative maybe do a V3 release that: