Conversation
# Conflicts: # .travis.yml # example_test.go # setup_test.go
* feat: add `FromChannelWithTimeout()` * feat: add `FromChannelWithContext` * chore: update README.md * fix: FromChannelWithContext args order * feat: remove FromChannelWithTimeout in favor of FromChannelWithContext
ahmetb
approved these changes
Oct 19, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
go-linq v4 (major release)
This PR merges the
v4branch tomasterand publishes go‑linq v4.0.0.v4 modernizes the library around Go’s standard iterator pattern, introduces typed constructors, adds context‑cancellable channel iteration, improves
ToSlicecapacity growth, and refreshes docs/examples.Highlights
Adopts Go’s standard iterator pattern (Go 1.23+).
Manual iteration over
Querynow follows theiterpackage pattern and integrates cleanly withfor … range. This is a breaking change for manual iteration.Typed constructors for common sources:
FromSlice,FromMap,FromChannel,FromChannelWithContext,FromString, andFromIterable. The legacyFrom()remains for convenience but is reflection‑based and not recommended for new code.Channel iteration w/ cancellation:
New
FromChannelWithContext(ctx, ch)allows to iterate over a channel with cancelation . (Closes how about add parameter timeout for FromChannelT? #93)ToSliceuses the standard growth strategy. (Closes WhyToSliceneed a custom grow strategy instead of the standard library? #109)ToSliceconverts query elements to the slice element type, if these can't be assigned directly.Docs/examples updated for v4, including
anyin place ofinterface{}and typed constructors throughout.Fixed Unit test ExampleOrderedQuery_ThenByDescending fails on golang-1.19.2 #113
Breaking changes
Manual iteration API changed. Code that previously relied on custom iterator functions must switch to the new pattern. Example from the README shows the transformation and the new
for … rangeergonomics.Removed:
FromChannelT()in favor ofFromChannel().Minimum Go version
Go 1.23+ (due to use of the standard iter package).