{"id":24856693,"url":"https://github.com/secondtruth/go-errors-ext","last_synced_at":"2025-08-11T17:08:12.650Z","repository":{"id":266626920,"uuid":"740195899","full_name":"secondtruth/go-errors-ext","owner":"secondtruth","description":"🚨 Extensions for error creation and handling in Go","archived":false,"fork":false,"pushed_at":"2024-01-07T19:50:56.000Z","size":3,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-11T07:52:29.922Z","etag":null,"topics":["error-handling","go-errors"],"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/secondtruth.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2024-01-07T19:50:32.000Z","updated_at":"2024-01-07T19:54:04.000Z","dependencies_parsed_at":"2024-12-05T08:44:18.019Z","dependency_job_id":"b82345e9-2ee0-49f0-87da-87d2508c6016","html_url":"https://github.com/secondtruth/go-errors-ext","commit_stats":null,"previous_names":["secondtruth/go-errors-ext"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/secondtruth/go-errors-ext","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/secondtruth%2Fgo-errors-ext","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/secondtruth%2Fgo-errors-ext/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/secondtruth%2Fgo-errors-ext/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/secondtruth%2Fgo-errors-ext/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/secondtruth","download_url":"https://codeload.github.com/secondtruth/go-errors-ext/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/secondtruth%2Fgo-errors-ext/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269922906,"owners_count":24496999,"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-08-11T02:00:10.019Z","response_time":75,"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":["error-handling","go-errors"],"created_at":"2025-01-31T16:45:43.300Z","updated_at":"2025-08-11T17:08:12.603Z","avatar_url":"https://github.com/secondtruth.png","language":"Go","readme":"# Go Errors Extensions\n\nThis library provides a set of extensions for error creation and handling in Go.\n\n## Installation\n\nTo install the go-errors-ext library, use the following command:\n\n\tgo get -u github.com/secondtruth/go-errors-ext\n\n## Quick Start\n\nAfter installation, you can import the library into your Go project:\n\n```go\nimport errorsx \"github.com/secondtruth/go-errors-ext/errors\"\n```\n\n\u003e [!NOTE]\n\u003e Renaming the package to `errorsx` is not always necessary, but is recommended to do it always\n\u003e to make a clear distinction between the standard `errors` package and this one.\n\n## Usage\n\n### Extending errors\n\nThe `Extend` and `Extendf` functions can be used to extend an existing error:\n\n```go\nbase := errors.New(\"base error\")\n\nextendedPlain := errorsx.Extend(base, \"error\")\nextendedFormatted := errorsx.Extendf(base, \"error with value %d\", 42)\n```\n\nSub-errors can also be provided:\n\n```go\nbase := errors.New(\"base error\")\nsub1 := errors.New(\"suberror 1\")\nsub2 := errors.New(\"suberror 2\")\n\nextendedPlain := errorsx.Extend(base, \"error\", sub1, sub2)\nextendedFormatted := errorsx.Extendf(base, \"error with value %d\", sub1, 42, sub2)\n```\n\nIn `Extendf`, sub-errors can be placed anywhere in the format args.\n\n### Testing errors\n\nThe `Extends` function can be used to test if an error extends another error:\n\n```go\nbase := errors.New(\"base error\")\nsub := errors.New(\"suberror\")\nextended1 := errorsx.Extend(base, \"error\", sub)\nextended2 := errorsx.Extend(extended1, \"error\")\n\nextends1 := errorsx.Extends(extended1, base) // true\nextends2 := errorsx.Extends(extended2, extended1) // true\nextendsSub := errorsx.Extends(extended1, sub) // false\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsecondtruth%2Fgo-errors-ext","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsecondtruth%2Fgo-errors-ext","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsecondtruth%2Fgo-errors-ext/lists"}