{"id":18712426,"url":"https://github.com/serkodev/singleflight-any","last_synced_at":"2025-06-26T20:38:11.771Z","repository":{"id":57657478,"uuid":"461158575","full_name":"serkodev/singleflight-any","owner":"serkodev","description":"Go singleflight with generics key \u0026 value","archived":false,"fork":false,"pushed_at":"2022-02-19T10:39:26.000Z","size":9,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-22T01:45:24.940Z","etag":null,"topics":["concurrency","generics","go","golang","singleflight"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/serkodev.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-02-19T10:32:24.000Z","updated_at":"2024-02-14T09:03:58.000Z","dependencies_parsed_at":"2022-08-26T05:21:37.383Z","dependency_job_id":null,"html_url":"https://github.com/serkodev/singleflight-any","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/serkodev/singleflight-any","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serkodev%2Fsingleflight-any","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serkodev%2Fsingleflight-any/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serkodev%2Fsingleflight-any/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serkodev%2Fsingleflight-any/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/serkodev","download_url":"https://codeload.github.com/serkodev/singleflight-any/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serkodev%2Fsingleflight-any/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262142161,"owners_count":23265684,"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":["concurrency","generics","go","golang","singleflight"],"created_at":"2024-11-07T12:42:46.845Z","updated_at":"2025-06-26T20:38:11.730Z","avatar_url":"https://github.com/serkodev.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# singleflight-any\n\nThis repo hard forks from [golang.org/x/sync/singleflight](https://pkg.go.dev/golang.org/x/sync/singleflight) and support generics to the Group and Key type. Comparing to the original version of singleflight, you are free to use any `comparable` key type instead of `string` only.\n\n## Install\n```\ngo get github.com/serkodev/singleflight-any@latest\n```\n## Usage\n\n`string` key, `string` value\n```golang\nvar g Group[string, string]\nv, _, _ := g.Do(\"foo\", func() (string, error) {\n    return \"bar\", nil\n})\n```\n\n`int` key, `string` value\n```golang\nvar g Group[int, string]\nv, _, _ := g.Do(123, func() (string, error) {\n    return \"bar\", nil\n})\n```\n\n## Requirements\n\ngo 1.18 or above.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserkodev%2Fsingleflight-any","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fserkodev%2Fsingleflight-any","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserkodev%2Fsingleflight-any/lists"}