{"id":27775776,"url":"https://github.com/akishichinibu/safegroup","last_synced_at":"2025-10-03T19:50:05.814Z","repository":{"id":290204294,"uuid":"973663006","full_name":"akishichinibu/safegroup","owner":"akishichinibu","description":"A panic-safe wrapper for Go's errgroup","archived":false,"fork":false,"pushed_at":"2025-04-27T14:28:52.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-27T15:27:18.177Z","etag":null,"topics":["errgroup","golang"],"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/akishichinibu.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,"zenodo":null}},"created_at":"2025-04-27T13:29:06.000Z","updated_at":"2025-04-27T14:28:55.000Z","dependencies_parsed_at":"2025-04-27T15:39:06.039Z","dependency_job_id":null,"html_url":"https://github.com/akishichinibu/safegroup","commit_stats":null,"previous_names":["akishichinibu/safegroup"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akishichinibu%2Fsafegroup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akishichinibu%2Fsafegroup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akishichinibu%2Fsafegroup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akishichinibu%2Fsafegroup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/akishichinibu","download_url":"https://codeload.github.com/akishichinibu/safegroup/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251639658,"owners_count":21619810,"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":["errgroup","golang"],"created_at":"2025-04-30T04:21:46.191Z","updated_at":"2025-10-03T19:50:00.749Z","avatar_url":"https://github.com/akishichinibu.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# safegroup\n\n`safegroup` is a wrapper around [golang.org/x/sync/errgroup](https://pkg.go.dev/golang.org/x/sync/errgroup), which automatically catches panics inside goroutines and converts them into errors, preventing the entire program from crashing.\n\nref: https://github.com/golang/go/issues/53757\n\n## Features\n\n- ✅ Compatible API with `errgroup`\n- ✅ Captures stack trace information on panic\n\n## Installation\n\n```bash\ngo get github.com/akishichinibu/safegroup\n```\n\n## Usage\n\n```go\npackage main\n\nimport (\n \"fmt\"\n \"github.com/akishichinibu/safegroup\"\n)\n\nfunc main() {\n sg := safegroup.New()\n\n sg.Go(func() error {\n  fmt.Println(\"this task runs normally\")\n  return nil\n })\n\n sg.Go(func() error {\n  panic(\"something went wrong\")\n })\n\n err := sg.Wait()\n if err != nil {\n  fmt.Printf(\"SafeGroup caught an error: %v\\n\", err)\n }\n}\n```\n\n## Panic Handling\n\nWhen a panic occurs inside a goroutine started by `Go` or `TryGo`, SafeGroup automatically recovers it and returns a `*PanicError` containing:\n\n- The panic value (`Expt`)\n\n- The captured stack trace (`Stack`)\n\nYou can safely log, report, or analyze panics without crashing your program.\n\n### Example\n\n```go\nif pErr, ok := err.(*safegroup.PanicError); ok {\n fmt.Printf(\"panic occurred: %v\\nstack trace:\\n%s\\n\", pErr.Expt, string(pErr.Stack))\n}\n```\n\n## License\n\nMIT License.\nParts of the test code are adapted from the Go project (BSD license).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakishichinibu%2Fsafegroup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fakishichinibu%2Fsafegroup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakishichinibu%2Fsafegroup/lists"}