{"id":27916803,"url":"https://github.com/mickamy/gopanix","last_synced_at":"2025-05-06T16:41:18.002Z","repository":{"id":288362867,"uuid":"967743553","full_name":"mickamy/gopanix","owner":"mickamy","description":"💥 Visualize your Go panics in the browser","archived":false,"fork":false,"pushed_at":"2025-04-17T12:56:12.000Z","size":1082,"stargazers_count":12,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-02T21:52:17.704Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mickamy.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-16T23:49:47.000Z","updated_at":"2025-04-21T17:53:16.000Z","dependencies_parsed_at":"2025-04-17T16:30:41.221Z","dependency_job_id":"4a381f76-01b3-412a-b950-d79a5f5d32bb","html_url":"https://github.com/mickamy/gopanix","commit_stats":null,"previous_names":["mickamy/gopanix"],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mickamy%2Fgopanix","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mickamy%2Fgopanix/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mickamy%2Fgopanix/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mickamy%2Fgopanix/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mickamy","download_url":"https://codeload.github.com/mickamy/gopanix/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252722225,"owners_count":21794002,"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":[],"created_at":"2025-05-06T16:41:12.466Z","updated_at":"2025-05-06T16:41:17.997Z","avatar_url":"https://github.com/mickamy.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gopanix\n\n\u003e 💥 Visualize your Go panics in the browser. Because stack traces deserve better.\n\n`gopanix` is a CLI and library for Go that turns panic stack traces into readable HTML reports.  \nUse it to debug Go crashes in a more comfortable, visual way — no more squinting at walls of text.\n\n![Screenshot](./assets/panic_report.png)\n\n## ✨ Features\n\n- 💥 Catch Go panics and recover automatically\n- 🌐 Generate an HTML report with stack trace and timestamp\n- 🧪 Run any Go program with `gopanix run`\n- 📦 Use as a library with `defer gopanix.Handle(bool)`\n  - Opens your browser automatically if `true` given\n- 🧘 Works without modifying the target program (CLI mode)\n\n---\n\n## 🚀 Usage\n\nYou can use `gopanix` in two ways:\n\n---\n\n### 📦 As a library\n\nAdd `gopanix` to your Go app and use `defer gopanix.Handle(bool)`:\n\n```bash\ngo get github.com/mickamy/gopanix@latest\n```\n\n```go\npackage main\n\nimport \"github.com/mickamy/gopanix\"\n\nfunc main() {\n\tdefer gopanix.Handle(false) // Set to true to open the report in your browser\n\n\tpanic(\"something went wrong!\")\n}\n```\n\nWhen a panic occurs, `gopanix` recovers it and opens a detailed HTML report in your browser.\n\nOr if you'd like to add it to an existing program, you can use it like this:\n\n```go\npackage main\n\nimport (\n  \"fmt\"\n  \"os\"\n\t\n  \"github.com/mickamy/gopanix\"\n  \"github.com/mickamy/gopanix/browser\"\n)\n\nfunc main() {\n  if r := recover(); r != nil {\n    filename, err := gopanix.Report(r)\n    if err != nil {\n      fmt.Printf(\"⚠️ Failed to generate report: %v\\n\", err)\n\t  os.Exit(1)\n    }\n\n    fmt.Printf(\"📄 panic file written to: %s\\n\", filename)\n    fmt.Println(\"🌐 Opening in browser...\")\n    _ = browser.Open(filename)\n    os.Exit(1)\n  }\n}\n```\n\n---\n\n### 🛠 As a CLI\n\nYou can run any Go program — even if it doesn't import gopanix.\n\n```bash\n# Install gopanix into your project\ngo get -tool github.com/mickamy/gopanix@latest\n\n# or install it globally\ngo install github.com/mickamy/gopanix@latest\n```\n\n#### `gopanix run`\n\n```bash\ngopanix run ./main.go\n```\n\n`gopanix run` will capture the panic output from go run, format it, and open an HTML report.\nIt wraps `go run`, captures any panic output, and opens a detailed HTML trace in your browser — no code changes needed.\n\n#### `gopanix test`\n\nThe `gopanix test` command runs `go test -json` under the hood and generates an HTML report if any panic is detected in the output.\n\n```bash\ngopanix test ./...\n```\n\n**Features**\n\n- Executes `go test -json` and parses the output\n- Detects panic stack traces and converts them to HTML\n- Displays failed test output as-is\n- Supports multiple panics — generates a report per panic\n- Automatically opens the report in your default browser\n\n```bash\n# Run all tests and capture panics\ngopanix test ./...\n\n# Run specific packages\ngopanix test ./foo ./bar\n```\n\n#### `gopanix report`\n\nReads panic output from stdin and generates a readable HTML report — perfect for piping `go test` or `go run` output.\n\n```bash\ngo test 2\u003e\u00261 | gopanix report\n```\n\nIf any `panic:` is found, `gopanix` will extract the stack trace and open it in your browser.\n\n## 📄 License\n\n[MIT](./LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmickamy%2Fgopanix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmickamy%2Fgopanix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmickamy%2Fgopanix/lists"}