{"id":16683085,"url":"https://github.com/hlts2/errgroup","last_synced_at":"2025-03-13T12:14:36.148Z","repository":{"id":57562896,"uuid":"331013040","full_name":"hlts2/errgroup","owner":"hlts2","description":"provides synchronization, error propagation, and Context cancelation for groups of goroutines working on subtasks of a common task","archived":false,"fork":false,"pushed_at":"2021-05-20T10:53:10.000Z","size":20,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-20T08:09:46.737Z","etag":null,"topics":["concurrency","errgroup","go","golang","goroutine","lilbraries","subtask"],"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/hlts2.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":"2021-01-19T14:48:56.000Z","updated_at":"2021-05-20T10:53:12.000Z","dependencies_parsed_at":"2022-09-16T10:41:32.680Z","dependency_job_id":null,"html_url":"https://github.com/hlts2/errgroup","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hlts2%2Ferrgroup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hlts2%2Ferrgroup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hlts2%2Ferrgroup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hlts2%2Ferrgroup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hlts2","download_url":"https://codeload.github.com/hlts2/errgroup/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243401511,"owners_count":20285058,"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","errgroup","go","golang","goroutine","lilbraries","subtask"],"created_at":"2024-10-12T14:10:18.287Z","updated_at":"2025-03-13T12:14:36.057Z","avatar_url":"https://github.com/hlts2.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# errgroup\n\n[![Go Report Card](https://goreportcard.com/badge/github.com/hlts2/errgroup)](https://goreportcard.com/report/github.com/hlts2/errgroup)\n[![GoDoc](http://godoc.org/github.com/hlts2/errgroup?status.svg)](http://godoc.org/github.com/hlts2/errgroup)\n\nProvide synchronization, error propagation, and Context cancelation for groups of goroutines working on subtasks of a common task.\nThis package highly inspired by [errgroup](https://github.com/golang/sync/tree/master/errgroup).\n\n\n## Requirement\n\nGo 1.15\n\n## Installing\n\n```\ngo get github.com/hlts2/errgroup\n```\n\n## Example\n\n```go\n\npackage main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\n\t\"github.com/hlts2/errgroup\"\n)\n\nfunc main() {\n\tvar urls = []string{\n\t\t\"http://www.golang.org/\",\n\t\t\"http://www.google.com/\",\n\t\t\"http://www.somestupidname.com/\",\n\t}\n\n\teg := new(errgroup.Group)\n\tfor _, url := range urls {\n\t\turl := url\n\t\teg.Go(func() error {\n\t\t\tresp, err := http.Get(url)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tdefer resp.Body.Close()\n\n\t\t\treturn nil\n\t\t})\n\t}\n\n\terr := eg.Wait()\n\tif err != nil {\n\t\tif err, ok := err.(errgroup.Error); ok {\n\t\t\tfmt.Println(err.Errors()) // slice of errors that occurred inside eg.Go\n\t\t}\n\t} else {\n\t\tfmt.Println(\"Successfully fetched all URLs.\")\n\t}\n}\n\n```\n\n## Contribution\n1. Fork it ( https://github.com/hlts2/errgroup/fork )\n2. Create your feature branch (git checkout -b my-new-feature)\n3. Commit your changes (git commit -am 'Add some feature')\n4. Push to the branch (git push origin my-new-feature)\n5. Create new Pull Request\n\n## Author\n[hlts2](https://github.com/hlts2)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhlts2%2Ferrgroup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhlts2%2Ferrgroup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhlts2%2Ferrgroup/lists"}