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

v3 #46

Merged
merged 2 commits into from
Dec 4, 2024
Merged

v3 #46

merged 2 commits into from
Dec 4, 2024

Conversation

pd93
Copy link
Contributor

@pd93 pd93 commented Nov 27, 2024

Closes #44

As discussed in #44, this PR proposes a couple of breaking changes (and therefore a major version bump to v3):

  • BREAKING - m.Keys() now returns an iter.Seq iterator instead of a list of keys.
    • This should be much more performant on large maps.
    • It is also more consistent with maps.Keys from the standard library.
  • Added m.Values() which returns an iter.Seq iterator.
    • Also consistent with maps.Values from the standard library.
  • BREAKING - Renamed Iterator() method to AllFromFront().
  • BREAKING - Renamed ReverseIterator() to AllFromBack().
  • Added All() method aliased to AllFromFront().
    • This is for consistency with the standard library's slices.All and maps.All.
  • Updated minimum version to 1.23
    • This also meant we can move the iterator methods into the main orderedmap.go file as they no longer need to be constrained by a build tag
  • Updated tests
  • Updated README
  • Updated CI to run on v3 and Go 1.23

I have submitted this PR in 2 commits. The first just directly copied the v2 code into the new v3 directory. The second commit contains the v3 changes. This should more easily allow you to see and review the actual changes.


This change is Reviewable

.github/workflows/ci.yaml Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
v3/orderedmap.go Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
v3/orderedmap.go Show resolved Hide resolved
pd93 added 2 commits December 4, 2024 20:22
- `m.Keys` returns an `iter.Seq` iterator instead of a list of keys.
- Added `m.Values` which returns an `iter.Seq` iterator.
- Renamed Iterator method to `AllFromFront`.
- Renamed ReverseIterator to `AllFromBack`.
- Added `All` method aliased to `AllFromFront`.
- Updated minimum version to 1.23
- Moved methods into main file as they no longer need to be constrained by a build tag
- Updated tests
@elliotchance elliotchance merged commit cc923df into elliotchance:master Dec 4, 2024
3 checks passed
@elliotchance
Copy link
Owner

Thank you @pd93 for this awesome work! It's now released as v3.0.0.

@pd93 pd93 deleted the v3 branch December 4, 2024 21:09
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.

iter.Seq and naming changes
2 participants