All Projects → solsw → go2linq

solsw / go2linq

Licence: MIT license
Generic Go implementation of .NET's LINQ to Objects.

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to go2linq

Observable
The easiest way to observe values in Swift.
Stars: ✭ 346 (+743.9%)
Mutual labels:  generic, generics
Goreuse
Generic Code for Go
Stars: ✭ 93 (+126.83%)
Mutual labels:  generic, generics
Gridify
Easy and optimized way to apply Filtering, Sorting, and Pagination using text-based data.
Stars: ✭ 372 (+807.32%)
Mutual labels:  linq, linq-to-objects
rueidis
A Fast Golang Redis RESP3 client that supports Client Side Caching, Auto Pipelining, Generics OM, RedisJSON, RedisBloom, RediSearch, RedisAI, RedisGears, etc.
Stars: ✭ 422 (+929.27%)
Mutual labels:  generics
go-callbag
golang implementation of Callbag
Stars: ✭ 19 (-53.66%)
Mutual labels:  generics
GenericAdapter
⛳️ Easy to use android databinding ready recyclerview adapter
Stars: ✭ 26 (-36.59%)
Mutual labels:  generic
linq-collections
Strongly typed Linq and Collections implementation for Javascript and TypeScript (ECMAScript 5)
Stars: ✭ 112 (+173.17%)
Mutual labels:  linq
Johnny
Melodic Caching for Swift
Stars: ✭ 36 (-12.2%)
Mutual labels:  generic
go-inline
Generic Data Structures/Algorithms in golang.
Stars: ✭ 52 (+26.83%)
Mutual labels:  generics
Swiftish
A fully generic Swift vector & matrix library
Stars: ✭ 17 (-58.54%)
Mutual labels:  generic
genx
GenX: Generics For Go, Yet Again.
Stars: ✭ 37 (-9.76%)
Mutual labels:  generics
UseCases
This a library that offers a generic implementation of the data layers from the clean architecture by Uncle bob.
Stars: ✭ 23 (-43.9%)
Mutual labels:  generic
atomig
Generic and convenient `std` atomics via `Atomic<T>`
Stars: ✭ 32 (-21.95%)
Mutual labels:  generic
LinqToXsdCore
LinqToXsd ported to .NET Core (targets .NET Standard 2 for generated code and .NET Core 3.1, .NET 5+ 6 for the code generator CLI tool).
Stars: ✭ 23 (-43.9%)
Mutual labels:  linq
anchor
Create Dynamic CLI's as your GitOps Marketplace
Stars: ✭ 38 (-7.32%)
Mutual labels:  generic
generic
Generic programming library for Python
Stars: ✭ 50 (+21.95%)
Mutual labels:  generic
js-linq
$linq is a Javascript version of .NET's Linq to Objects, with some query operations inspired by MoreLinq (an extension to Linq to Objects).
Stars: ✭ 34 (-17.07%)
Mutual labels:  linq
io-api
📐 API design example by I/O, the demo implementation of https://dzone.com/articles/generic-inputoutput-api-java
Stars: ✭ 46 (+12.2%)
Mutual labels:  generic
ertis-auth
Generic token generator and validator service like auth
Stars: ✭ 28 (-31.71%)
Mutual labels:  generic
SqlBatis
A high performance Micro-ORM supporting SQL Server, MySQL, Sqlite etc..
Stars: ✭ 34 (-17.07%)
Mutual labels:  linq

go2linq Go Reference

go2linq is Go implementation of .NET's LINQ to Objects. (See also: Language Integrated Query, LINQ, Enumerable Class.)

go2linq uses generics, so it requires at least Go 1.18.

go2linq was initially inspired by Jon Skeet's Edulinq series.


Installation

go get github.com/solsw/go2linq/v2@latest

Examples

Examples of go2linq usage are in the Example... functions in test files (see Examples).

Quick and easy example:

//go:build go1.18

package main

import (
	"fmt"

	"github.com/solsw/go2linq/v2"
)

func main() {
	filter := go2linq.WhereMust(
		go2linq.NewEnSlice(1, 2, 3, 4, 5, 6, 7, 8),
		func(i int) bool { return i > 6 || i%2 == 0 },
	)
	squares := go2linq.SelectMust(
		filter,
		func(i int) string { return fmt.Sprintf("%d: %d", i, i*i) },
	)
	enr := squares.GetEnumerator()
	for enr.MoveNext() {
		square := enr.Current()
		fmt.Println(square)
	}
}

The previous code outputs the following:

2: 4
4: 16
6: 36
7: 49
8: 64
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].