Releases: ahmetb/go-linq
v4.0.0 (2025-10-20)
What's Changed
-
Adopts Go’s standard iterator pattern (Go 1.23+).
Manual iteration overQuerynow 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:
NewFromChannelWithContext(ctx, ch)allows to iterate over a channel with cancelation . (Closes #93) -
ToSliceuses the standard growth strategy. (Closes #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 #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).
Full Changelog: v3.2.0...v4.0.0
v3.2.0 (2020-12-29)
- Added FromChannelT().
- Added DefaultIfEmpty().
v3.0.0 (2017-01-10)
- Breaking change:
ToSlice()now overwrites existing slice starting
from index 0 and grows/reslices it as needed. - Generic/parametrized methods support (Thanks @cleitonmarx!)
- Accepting parametrized functions was originally proposed in #26
- You can now avoid type assertions and
interface{}s - Functions with generic methods are named as
MethodNameT - Method signatures for the existing LINQ methods are unchanged.
- Added
ForEach(),ForEachIndexed()andAggregateWithSeedBy().
Also thanks @kalaninja for working on this release.
v2.0.0 (2016-09-02)
IMPORTANT: Breaking Changes
v2.0 release contains BREAKING changes to the API.
The old version is archived at the archive/0.9 branch or the 0.9 tags.
Changelog
- v2.0 is A COMPLETE REWRITE of go-linq with better performance and memory
efficiency.
(thanks @kalaninja!) - API has significantly changed. Most notably:
- linq.T removed in favor of interface{}
- library methods no longer return errors
- PLINQ removed for now (see channels support)
- support for channels, custom collections and comparables