{"id":38211210,"url":"https://github.com/yoyofx/glinq","last_synced_at":"2026-01-17T00:43:28.014Z","repository":{"id":56854377,"uuid":"481533237","full_name":"yoyofx/glinq","owner":"yoyofx","description":"Linq and A collection of generic data structures written in Go.","archived":false,"fork":false,"pushed_at":"2022-08-19T06:39:54.000Z","size":25,"stargazers_count":6,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-06-20T13:34:47.577Z","etag":null,"topics":["collection","data-structures","golang","linq"],"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/yoyofx.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}},"created_at":"2022-04-14T08:52:44.000Z","updated_at":"2024-02-04T06:06:48.000Z","dependencies_parsed_at":"2022-09-21T12:10:59.651Z","dependency_job_id":null,"html_url":"https://github.com/yoyofx/glinq","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/yoyofx/glinq","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yoyofx%2Fglinq","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yoyofx%2Fglinq/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yoyofx%2Fglinq/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yoyofx%2Fglinq/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yoyofx","download_url":"https://codeload.github.com/yoyofx/glinq/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yoyofx%2Fglinq/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28490523,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T23:55:29.509Z","status":"ssl_error","status_checked_at":"2026-01-16T23:55:29.108Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["collection","data-structures","golang","linq"],"created_at":"2026-01-17T00:43:27.220Z","updated_at":"2026-01-17T00:43:28.003Z","avatar_url":"https://github.com/yoyofx.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# glinq\nA collection of generic data structures and LINQ written in Go.\n\n## data structures include:\n* List\n* Linked List\n* Array\n* Stack\n* B Tree\n\n## examples:\n```go\nvar employees = NewListOf([]Employee{\n\t{\"Hao\", 44, 0, 8000.5},\n\t{\"Bob\", 36, 10, 5000.5},\n\t{\"Alice\", 23, 5, 9000.0},\n\t{\"Jack\", 26, 0, 4000.0},\n\t{\"Tom\", 48, 9, 7500.75},\n\t{\"Marry\", 29, 0, 6000.0},\n\t{\"Mike\", 38, 8, 4000.3},\n})\n\nfunc TestEmployeeList(t *testing.T) {\n\t// 添加 Max 员工\n\temployees.Push(Employee{\"Max\", 26, 0, 4000.0})\n\t// 所有人的薪水\n\ttotalPaySalary := Reduce(employees.ToQueryable(), 0.0, func(result float64, employee Employee) float64 {\n\t\treturn result + employee.Salary\n\t})\n\tassert.Equal(t, totalPaySalary, 43502.05+4000.0)\n\n\t//统计年龄大于40岁的员工数\n\torderCount := employees.ToQueryable().Where(func(employee Employee) bool {\n\t\treturn employee.Age \u003e 35\n\t}).Count()\n\tassert.Equal(t, orderCount, 4)\n\n\t//统计薪水超过 6000元的员工数\n\tmoreThan6000Count := employees.ToQueryable().Where(func(employee Employee) bool {\n\t\treturn employee.Salary \u003e= 6000\n\t}).Count()\n\tassert.Equal(t, moreThan6000Count, 4)\n\n\t//统计年龄小于30岁员工要支付的所有薪水 [ Max: 4000.0, Alice: 9000.0 ,Jack: 4000.0, Marry: 6000.0 ] = 23000.0\n\temployeeQuery := employees.ToQueryable()\n\t// Reduce are equal Sum of Map to Queryable\n\tyoungerTotalPaySalary := Reduce(Map(employeeQuery.Where(func(employee Employee) bool {\n\t\treturn employee.Age \u003c 30\n\t}), func(e Employee) float64 {\n\t\treturn e.Salary\n\t}), 0.0, func(result float64, item float64) float64 {\n\t\treturn result + item\n\t})\n\tassert.Equal(t, youngerTotalPaySalary, 23000.0)\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyoyofx%2Fglinq","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyoyofx%2Fglinq","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyoyofx%2Fglinq/lists"}