A Go library providing .NET LINQ-style query capabilities for arrays, slices, maps, strings, channels, and custom collections.
go-linq is a Go library that implements .NET LINQ (Language Integrated Query) capabilities, allowing developers to write declarative, chainable queries for data manipulation. It provides a fluent API to filter, transform, aggregate, and iterate over collections like slices, maps, and channels without verbose loops or manual type assertions.
Go developers working with complex data transformations, especially those familiar with .NET LINQ or functional programming patterns who want expressive query syntax in Go.
It eliminates boilerplate code for collection operations, offers lazy evaluation for performance, and supports both reflection-based generic functions for readability and type-safe constructors for efficiency, all with zero external dependencies.
.NET LINQ capabilities in Go
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Implements an iterator pattern for on-demand processing, reducing memory overhead when working with large datasets or infinite sequences like channels.
Designed to be safely used across multiple goroutines, aligning with Go's concurrency model without requiring additional synchronization code.
Works with arrays, slices, maps, strings, channels, and custom collections via optimized constructors like FromSlice and FromMap, avoiding reflection overhead where possible.
Exposes an Iterate field compatible with Go's native iter.Seq since v4, enabling seamless iteration in for-range loops and better ecosystem alignment.
Written entirely in vanilla Go with no third-party imports, minimizing project bloat and version conflict risks.
Generic functions (e.g., WhereT, SelectT) are 5x-10x slower due to reflection, as admitted in the README, making them unsuitable for high-throughput scenarios.
History of major breaking changes, such as the v4.0.0 migration to Go's iterator pattern and v3.0.0 complete rewrite, can disrupt upgrades and require code modifications.
Basic operations like filtering a slice are more verbose with LINQ chaining compared to native Go loops, adding unnecessary complexity for straightforward use cases.