{"id":17726952,"url":"https://github.com/fs02/go-paranoid","last_synced_at":"2026-01-12T11:32:42.351Z","repository":{"id":57489762,"uuid":"105072002","full_name":"Fs02/go-paranoid","owner":"Fs02","description":"Let it panic!","archived":false,"fork":false,"pushed_at":"2019-01-22T11:09:11.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-13T23:37:32.852Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Fs02.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":"2017-09-27T21:37:18.000Z","updated_at":"2019-07-14T22:12:02.000Z","dependencies_parsed_at":"2022-08-29T15:12:04.231Z","dependency_job_id":null,"html_url":"https://github.com/Fs02/go-paranoid","commit_stats":null,"previous_names":["fs02/paranoid"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Fs02/go-paranoid","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fs02%2Fgo-paranoid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fs02%2Fgo-paranoid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fs02%2Fgo-paranoid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fs02%2Fgo-paranoid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Fs02","download_url":"https://codeload.github.com/Fs02/go-paranoid/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fs02%2Fgo-paranoid/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270932580,"owners_count":24670241,"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-17T02:00:09.016Z","response_time":129,"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-10-25T17:22:14.261Z","updated_at":"2026-01-12T11:32:42.321Z","avatar_url":"https://github.com/Fs02.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GO Paranoid\nParanoid is utilities supplemental to go panic, it usefull when you want to make your code panic on unhandled error, it also make your test case simpler by reducing the test branch.\n\n## Usage\n```golang\npackage main\n\nimport (\n\t\"errors\"\n\t\"github.com/Fs02/go-paranoid\"\n\t\"github.com/jinzhu/gorm\"\n\t_ \"github.com/jinzhu/gorm/dialects/mysql\"\n)\n\ntype Transaction struct {\n\tID uint\n}\n\nfunc retrieve() (Transaction, error) {\n\tdb, err := gorm.Open(\"mysql\", \"root@(127.0.0.1:3306)/db?charset=utf8\u0026parseTime=True\u0026loc=Local\")\n\t// panic if error\n\tparanoid.Panic(err, \"Error opening database connection\")\n\n\ttrx := Transaction{}\n\tquery := db.First(\u0026trx, 1000)\n\n\tif query.RecordNotFound() {\n\t\treturn trx, errors.New(\"not found\")\n\t}\n\n\t// it'll panic on unknown or untestable error\n\tparanoid.Panic(query.Error, \"Failed when fetching transaction %+v\", trx)\n\treturn trx, nil\n}\n\nfunc main() {\n\tretrieve()\n}\n```\n\nThere's also `paranoid.PanicFunc` which usefull when you want to run any specific function before panic (ie: rollback).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffs02%2Fgo-paranoid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffs02%2Fgo-paranoid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffs02%2Fgo-paranoid/lists"}