{"id":20550202,"url":"https://github.com/dnmfarrell/go-errval","last_synced_at":"2025-09-11T09:36:08.911Z","repository":{"id":149703687,"uuid":"434731541","full_name":"dnmfarrell/go-errval","owner":"dnmfarrell","description":"Provides a generic error catching interface to reduce boilerplate and fragile error checking code","archived":false,"fork":false,"pushed_at":"2021-12-06T14:31:55.000Z","size":2,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-06T05:43:48.276Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dnmfarrell.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2021-12-03T20:57:04.000Z","updated_at":"2021-12-06T14:31:57.000Z","dependencies_parsed_at":null,"dependency_job_id":"a162201b-cf42-4217-ab74-962976d41bcd","html_url":"https://github.com/dnmfarrell/go-errval","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dnmfarrell/go-errval","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dnmfarrell%2Fgo-errval","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dnmfarrell%2Fgo-errval/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dnmfarrell%2Fgo-errval/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dnmfarrell%2Fgo-errval/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dnmfarrell","download_url":"https://codeload.github.com/dnmfarrell/go-errval/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dnmfarrell%2Fgo-errval/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274609465,"owners_count":25316621,"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":"2025-09-11T02:00:13.660Z","response_time":74,"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":"2024-11-16T02:23:49.462Z","updated_at":"2025-09-11T09:36:08.833Z","avatar_url":"https://github.com/dnmfarrell.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"errval\n------\nerrval is a go package that uses generics to return a single value which contains either an error or a value. The `Catch` method is used to handle the error or return the value:\n\n\tif ok, val := foo().Catch(logger); ok {\n\t\tfmt.Println(val)\n\t\t// Output: bar\n\t}\n\nThis requires callers to explictly handle potential errors. However whilst experimenting with errval I found it didn't help shorten or de-obfuscate code with sequential calls that must return the first error found ([example](https://go.googlesource.com/proposal/+/master/design/go2draft-error-handling-overview.md)).\n\nThe root problem of golang's mundane error handling is its strict differentiation between expressions and statements: since only statements control program execution, do not compose (and `goto` is neutured), it requires new statement types to be added to the language to provide try/catch style exception handling.\n\nThe current [Go2 proposal](https://go.googlesource.com/proposal/+/master/design/go2draft-error-handling-overview.md) describes a check/handle mechanism which is similar to try/catch.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdnmfarrell%2Fgo-errval","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdnmfarrell%2Fgo-errval","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdnmfarrell%2Fgo-errval/lists"}