{"id":13714323,"url":"https://github.com/solsw/go2linq","last_synced_at":"2026-01-03T17:15:50.244Z","repository":{"id":38413681,"uuid":"427105928","full_name":"solsw/go2linq","owner":"solsw","description":"Generic Go implementation of .NET's LINQ to Objects.","archived":false,"fork":false,"pushed_at":"2024-11-09T16:00:58.000Z","size":908,"stargazers_count":62,"open_issues_count":0,"forks_count":6,"subscribers_count":1,"default_branch":"v4","last_synced_at":"2024-11-09T17:17:18.016Z","etag":null,"topics":["enumerable","generic","generics","go","golang","iterator","linq","linq-to-objects"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/solsw.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-11-11T18:39:04.000Z","updated_at":"2024-11-09T16:01:01.000Z","dependencies_parsed_at":"2024-03-31T15:21:31.146Z","dependency_job_id":"e66ced26-e877-4ae1-9430-374d50dd4d37","html_url":"https://github.com/solsw/go2linq","commit_stats":null,"previous_names":[],"tags_count":173,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solsw%2Fgo2linq","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solsw%2Fgo2linq/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solsw%2Fgo2linq/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solsw%2Fgo2linq/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/solsw","download_url":"https://codeload.github.com/solsw/go2linq/tar.gz/refs/heads/v4","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224551223,"owners_count":17330103,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["enumerable","generic","generics","go","golang","iterator","linq","linq-to-objects"],"created_at":"2024-08-02T23:01:57.039Z","updated_at":"2025-12-15T16:44:06.738Z","avatar_url":"https://github.com/solsw.png","language":"Go","funding_links":[],"categories":["Repositories"],"sub_categories":[],"readme":"# go2linq\n[![Go Reference](https://pkg.go.dev/badge/github.com/solsw/go2linq.svg)](https://pkg.go.dev/github.com/solsw/go2linq/v4)\n\n[\u003cimg src=\"https://api.gitsponsors.com/api/badge/img?id=427105928\" height=\"20\"\u003e](https://api.gitsponsors.com/api/badge/link?p=JuJstBNp7ndvJE51saddkORQC9tJKbhThJOER++0kJb1kqonUPOnKXTv2w4yRhJ9ukTgSIu3Uvj+vYYAKMdEQECKTFSCouvgBUkFNTNJ8aOJKxIwMtLdUqa8v2k+kPZy)\n\n**go2linq** is Go implementation of .NET's \n[LINQ to Objects](https://learn.microsoft.com/dotnet/csharp/programming-guide/concepts/linq/linq-to-objects).\n(See also: [Language Integrated Query](https://en.wikipedia.org/wiki/Language_Integrated_Query),\n[LINQ](https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/concepts/linq/),\n[Enumerable Class](https://learn.microsoft.com/dotnet/api/system.linq.enumerable).)\n\n**v4** of **go2linq** is based on Go [Iterators](https://pkg.go.dev/iter#hdr-Iterators).\n\n---\n\n## Installation\n\n```\ngo get github.com/solsw/go2linq/v4\n```\n\n## Examples\n\nExamples of **go2linq** usage are in the `Example...` functions in test files\n(see [Examples](https://pkg.go.dev/github.com/solsw/go2linq/v4#pkg-examples)).\n\n### Quick and easy example:\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/solsw/go2linq/v4\"\n)\n\nfunc main() {\n\tfilter, _ := go2linq.Where(\n\t\tgo2linq.iterhelper.VarSeq(1, 2, 3, 4, 5, 6, 7, 8),\n\t\tfunc(i int) bool { return i \u003e 6 || i%2 == 0 },\n\t)\n\tsquares, _ := go2linq.Select(\n\t\tfilter,\n\t\tfunc(i int) string { return fmt.Sprintf(\"%d: %d\", i, i*i) },\n\t)\n\tfor square := range squares {\n\t\tfmt.Println(square)\n\t}\n}\n```\n\nThe previous code outputs the following:\n```\n2: 4\n4: 16\n6: 36\n7: 49\n8: 64\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsolsw%2Fgo2linq","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsolsw%2Fgo2linq","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsolsw%2Fgo2linq/lists"}