Go2linq
Generic Go implementation of .NET's LINQ to Objects.
Install / Use
/learn @solsw/Go2linqREADME
go2linq
<img src="https://api.gitsponsors.com/api/badge/img?id=427105928" height="20">
go2linq is Go implementation of .NET's LINQ to Objects. (See also: Language Integrated Query, LINQ, Enumerable Class.)
v4 of go2linq is based on Go Iterators.
Installation
go get github.com/solsw/go2linq/v4
Examples
Examples of go2linq usage are in the Example... functions in test files
(see Examples).
Quick and easy example:
package main
import (
"fmt"
"github.com/solsw/go2linq/v4"
)
func main() {
filter, _ := go2linq.Where(
go2linq.iterhelper.VarSeq(1, 2, 3, 4, 5, 6, 7, 8),
func(i int) bool { return i > 6 || i%2 == 0 },
)
squares, _ := go2linq.Select(
filter,
func(i int) string { return fmt.Sprintf("%d: %d", i, i*i) },
)
for square := range squares {
fmt.Println(square)
}
}
The previous code outputs the following:
2: 4
4: 16
6: 36
7: 49
8: 64
Related Skills
node-connect
340.5kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
xurl
340.5kA CLI tool for making authenticated requests to the X (Twitter) API. Use this skill when you need to post tweets, reply, quote, search, read posts, manage followers, send DMs, upload media, or interact with any X API v2 endpoint.
frontend-design
84.2kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
340.5kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
