Skip to content

Add go1.23 iterator support #160

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

Closed
wants to merge 6 commits into from
Closed

Add go1.23 iterator support #160

wants to merge 6 commits into from

Conversation

freeformz
Copy link

@freeformz freeformz commented Mar 2, 2025

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:

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:

  1. supports only go1.23+
  2. Drops the old Iter and Iterator methods.
  3. Any other API cleanups you want to do.

For go1.22 and below provide the same function, with docs
but panic if the function is called.

For go1.23+ add deprecation notice to the old
iterator functions.
@freeformz freeformz marked this pull request as ready for review March 2, 2025 22:30
@freeformz freeformz closed this Mar 3, 2025
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.

1 participant