{"id":35672393,"url":"https://github.com/bborbe/run","last_synced_at":"2026-01-20T16:41:56.719Z","repository":{"id":144201882,"uuid":"72949238","full_name":"bborbe/run","owner":"bborbe","description":"Run helpers for Go","archived":false,"fork":false,"pushed_at":"2025-12-05T22:38:21.000Z","size":8651,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-09T12:35:19.115Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bborbe.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2016-11-05T19:42:11.000Z","updated_at":"2025-12-05T22:38:25.000Z","dependencies_parsed_at":"2023-06-18T05:15:56.946Z","dependency_job_id":"77c8c691-f6a0-4702-90f0-b011ac066a17","html_url":"https://github.com/bborbe/run","commit_stats":null,"previous_names":[],"tags_count":28,"template":false,"template_full_name":null,"purl":"pkg:github/bborbe/run","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bborbe%2Frun","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bborbe%2Frun/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bborbe%2Frun/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bborbe%2Frun/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bborbe","download_url":"https://codeload.github.com/bborbe/run/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bborbe%2Frun/sbom","scorecard":{"id":228060,"data":{"date":"2025-08-11","repo":{"name":"github.com/bborbe/run","commit":"57b10a3646501f08c9d004ee543ffb38c619a5a3"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.4,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":10,"reason":"18 commit(s) and 2 issue activity found in the last 90 days -- score normalized to 10","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/bborbe/run/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/bborbe/run/ci.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:27: update your workflow using https://app.stepsecurity.io/secureworkflow/bborbe/run/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/claude-code-review.yml:31: update your workflow using https://app.stepsecurity.io/secureworkflow/bborbe/run/claude-code-review.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/claude-code-review.yml:37: update your workflow using https://app.stepsecurity.io/secureworkflow/bborbe/run/claude-code-review.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/claude.yml:90: update your workflow using https://app.stepsecurity.io/secureworkflow/bborbe/run/claude.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/claude.yml:96: update your workflow using https://app.stepsecurity.io/secureworkflow/bborbe/run/claude.yml/master?enable=pin","Info:   0 out of   4 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   3 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Dangerous-Workflow","score":0,"reason":"dangerous workflow patterns detected","details":["Warn: script injection with untrusted input ' contains(github.event.comment.body, '@claude') ': .github/workflows/claude.yml:49","Warn: script injection with untrusted input ' contains(github.event.review.body, '@claude') ': .github/workflows/claude.yml:49","Warn: script injection with untrusted input ' contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude') ': .github/workflows/claude.yml:49"],"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Info: jobLevel 'contents' permission set to 'read': .github/workflows/claude-code-review.yml:24","Info: jobLevel 'pull-requests' permission set to 'read': .github/workflows/claude-code-review.yml:25","Info: jobLevel 'issues' permission set to 'read': .github/workflows/claude-code-review.yml:26","Info: jobLevel 'contents' permission set to 'read': .github/workflows/claude.yml:83","Info: jobLevel 'pull-requests' permission set to 'read': .github/workflows/claude.yml:84","Info: jobLevel 'issues' permission set to 'read': .github/workflows/claude.yml:85","Info: jobLevel 'actions' permission set to 'read': .github/workflows/claude.yml:87","Warn: no topLevel permission defined: .github/workflows/ci.yml:1","Warn: no topLevel permission defined: .github/workflows/claude-code-review.yml:1","Warn: no topLevel permission defined: .github/workflows/claude.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: BSD 2-Clause \"Simplified\" License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":3,"reason":"branch protection is not maximal on development and all release branches","details":["Info: 'allow deletion' disabled on branch 'master'","Info: 'force pushes' disabled on branch 'master'","Info: 'branch protection settings apply to administrators' is required to merge on branch 'master'","Warn: could not determine whether codeowners review is allowed","Warn: no status checks found to merge onto branch 'master'","Warn: PRs are not required to make changes on branch 'master'; or we don't have data to detect it.If you think it might be the latter, make sure to run Scorecard with a PAT or use Repo Rules (that are always public) instead of Branch Protection settings"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 3 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-17T04:12:28.084Z","repository_id":144201882,"created_at":"2025-08-17T04:12:28.084Z","updated_at":"2025-08-17T04:12:28.084Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28218052,"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","status":"online","status_checked_at":"2026-01-05T02:00:06.358Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2026-01-05T19:02:20.681Z","updated_at":"2026-01-05T19:04:09.903Z","avatar_url":"https://github.com/bborbe.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Run\n\n[![Go Reference](https://pkg.go.dev/badge/github.com/bborbe/run.svg)](https://pkg.go.dev/github.com/bborbe/run)\n[![Go Report Card](https://goreportcard.com/badge/github.com/bborbe/run)](https://goreportcard.com/report/github.com/bborbe/run)\n\nA Go library for parallel function execution with different error handling strategies and utilities.\n\n## Features\n\n- **Parallel Execution**: Run multiple functions concurrently with various error handling strategies\n- **Error Handling**: Choose from different error handling approaches (fail-fast, collect all, etc.)\n- **Retry Logic**: Built-in retry functionality with configurable backoff\n- **Context Support**: Full context.Context support for cancellation and timeouts  \n- **Utilities**: Additional helpers for delayed execution, parallel skipping, and more\n\n## Installation\n\n```bash\ngo get github.com/bborbe/run\n```\n\n## Quick Start\n\n```go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/bborbe/run\"\n)\n\nfunc main() {\n    ctx := context.Background()\n    \n    // Run functions in parallel, stop on first error\n    err := run.CancelOnFirstError(ctx,\n        func(ctx context.Context) error {\n            fmt.Println(\"Task 1\")\n            return nil\n        },\n        func(ctx context.Context) error {\n            fmt.Println(\"Task 2\") \n            return nil\n        },\n    )\n    \n    if err != nil {\n        fmt.Printf(\"Error: %v\\n\", err)\n    }\n}\n```\n\n## Execution Strategies\n\n### Parallel Execution with Error Handling\n\n```go\n// Cancel all remaining functions when first one finishes\nerr := run.CancelOnFirstFinish(ctx, funcs...)\n\n// Cancel all remaining functions when first error occurs\nerr := run.CancelOnFirstError(ctx, funcs...)\n\n// Run all functions, collect all errors\nerr := run.All(ctx, funcs...)\n\n// Run functions sequentially\nerr := run.Sequential(ctx, funcs...)\n```\n\n### Retry with Backoff\n\n```go\nretryableFunc := run.Retry(run.Backoff{\n    Delay:   time.Second,\n    Factor:  2.0,\n    Retries: 3,\n    IsRetryAble: func(err error) bool {\n        // Custom logic to determine if error is retryable\n        return true\n    },\n}, func(ctx context.Context) error {\n    // Your function that may fail\n    return someOperation(ctx)\n})\n\nerr := retryableFunc(ctx)\n```\n\n### Delayed Execution\n\n```go\n// Delay execution by 5 seconds\ndelayedFunc := run.Delayed(func(ctx context.Context) error {\n    fmt.Println(\"This runs after 5 seconds\")\n    return nil\n}, 5*time.Second)\n\nerr := delayedFunc(ctx)\n```\n\n### Prevent Parallel Execution\n\n```go\nskipper := run.NewParallelSkipper()\n\n// Wrap function to prevent parallel execution\nprotectedFunc := skipper.SkipParallel(func(ctx context.Context) error {\n    // This function will be skipped if already running\n    return expensiveOperation(ctx)\n})\n```\n\n## Core Types\n\nThe library is built around two main interfaces:\n\n```go\n// Func is a function that can be executed with context\ntype Func func(context.Context) error\n\n// Runnable interface for objects that can be run\ntype Runnable interface {\n    Run(ctx context.Context) error\n}\n```\n\n## Advanced Usage\n\n### Custom Error Handling\n\n```go\n// Get a channel of errors for custom processing\nerrorChan := run.Run(ctx, funcs...)\nfor err := range errorChan {\n    if err != nil {\n        log.Printf(\"Function failed: %v\", err)\n    }\n}\n```\n\n### Background Runners\n\n```go\n// For long-running background tasks\nrunner := run.NewBackgroundRunner()\n// ... (see source code for full API)\n```\n\n## Examples\n\n### Web Server with Graceful Shutdown\n\n```go\nfunc startServer(ctx context.Context) error {\n    server := \u0026http.Server{Addr: \":8080\"}\n    \n    return run.CancelOnFirstFinish(ctx,\n        func(ctx context.Context) error {\n            // Start server\n            return server.ListenAndServe()\n        },\n        func(ctx context.Context) error {\n            // Wait for context cancellation\n            \u003c-ctx.Done()\n            // Graceful shutdown\n            return server.Shutdown(context.Background())\n        },\n    )\n}\n```\n\n### Parallel Data Processing\n\n```go\nfunc processData(ctx context.Context, items []string) error {\n    var funcs []run.Func\n    \n    for _, item := range items {\n        item := item // capture loop variable\n        funcs = append(funcs, func(ctx context.Context) error {\n            return processItem(ctx, item)\n        })\n    }\n    \n    // Process all items, collect all errors\n    return run.All(ctx, funcs...)\n}\n```\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## License\n\nThis project is licensed under the BSD-style license. See the LICENSE file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbborbe%2Frun","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbborbe%2Frun","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbborbe%2Frun/lists"}