A powerful language integrated query library for Go. Inspired by Microsoft's LINQ.
- No dependencies: written in vanilla Go!
- Tested: 100.0% code coverage on all stable releases.
- Backwards compatibility: Your integration with the library will not be broken except major releases.
$ go get github.com/ahmetalpbalkan/go-linq
Example query: Find names of students over 18:
import . "github.com/ahmetalpbalkan/go-linq"
type Student struct {
id, age int
name string
}
over18Names, err := From(students)
.Where(func (s T) (bool,error){
return s.(*Student).age >= 18, nil
})
.Select(func (s T) (T,error){
return s.(*Student).name, nil
}).Results()
Here is wiki:
- Install & Import
- Quickstart (Crash Course)
- Parallel LINQ
- Table of Query Functions
- Remarks & Notes
- FAQ
This software is distributed under Apache 2.0 License (see LICENSE for more).
As noted in LICENSE, this library is distributed on an "as is" basis and author's employment association with Microsoft does not imply any sort of warranty or official representation the company. This is purely a personal side project developed on spare times.
Ahmet Alp Balkan – @ahmetalpbalkan
v0.0-rc3.2
* bugfix: All() iterating over values instead of indices
v0.9-rc3.1
* bugfix: modifying result slice affects subsequent query methods
v0.9-rc3
* removed FirstOrNil, LastOrNil, ElementAtOrNil methods
v0.9-rc2.5
* slice-accepting methods accept slices of any type with reflections
v0.9-rc2
* parallel linq (plinq) implemented
* Queryable separated into Query & ParallelQuery
* fixed early termination for All
v0.9-rc1
* many linq methods are implemented
* methods have error handling support
* type assertion limitations are unresolved
* travis-ci.org build integrated
* open sourced on github, master & dev branches