{"id":17247414,"url":"https://github.com/x1unix/chanspy","last_synced_at":"2025-03-26T05:40:44.706Z","repository":{"id":229371508,"uuid":"776560624","full_name":"x1unix/chanspy","owner":"x1unix","description":"The easiest way to check if Go channel is closed","archived":false,"fork":false,"pushed_at":"2024-03-24T07:56:23.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-31T07:16:10.027Z","etag":null,"topics":["channels","golang","golang-package"],"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/x1unix.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}},"created_at":"2024-03-23T20:59:33.000Z","updated_at":"2024-03-24T06:50:56.000Z","dependencies_parsed_at":"2024-03-23T22:21:36.096Z","dependency_job_id":"26d8d222-202c-4b19-9bdf-112493e2788b","html_url":"https://github.com/x1unix/chanspy","commit_stats":null,"previous_names":["x1unix/chanspy"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/x1unix%2Fchanspy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/x1unix%2Fchanspy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/x1unix%2Fchanspy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/x1unix%2Fchanspy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/x1unix","download_url":"https://codeload.github.com/x1unix/chanspy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245598292,"owners_count":20641882,"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":["channels","golang","golang-package"],"created_at":"2024-10-15T06:37:44.730Z","updated_at":"2025-03-26T05:40:44.675Z","avatar_url":"https://github.com/x1unix.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Chanspy\n\n\u003e Go Channel Spy\n\n[![Goreportcard](https://goreportcard.com/badge/github.com/x1unix/chanspy)](https://goreportcard.com/report/github.com/x1unix/chanspy)\n[![Go Reference](https://pkg.go.dev/badge/github.com/x1unix/chanspy.svg)](https://pkg.go.dev/github.com/x1unix/chanspy)\n\nThis module contains helpers for Go channel types like:\n\n* Checking if channel is closed without read.\n* Obtaining channel length and capacity.\n* etc.\n\n## Disclaimer\n\nThis package (ab)uses unsafe techniques, use with caution.\n\n\u003e I'm not responsible for broken deployments, segfaults, thermonuclear war, or you getting fired because undefined behavior in the code led to a company going bankrupt.\n\u003e Please do some research if you have any concerns about features included in this package before using it!\n\u003e YOU are choosing to make these modifications, and if you point the finger at me for messing up your program, I will laugh at you.\n\n## Usage\n\n```go\npackage main\n\nimport (\n    \"fmt\"\n\n    \"github.com/x1unix/chanspy\"\n)\n\nfunc main() {\n    // This is a fast way to check if channel is closed without block.\n    // Use chanspy.ValueOf(ch, chanspy.WithLock) for thread-safe way.\n    ch := make(chan int)\n    fmt.Println(chanspy.IsClosed(ch)) // Prints: false\n\n    close(ch)\n    fmt.Println(chanspy.IsClosed(ch)) // Prints: true\n}\n```\n\nSee [examples](./example_test.go) for more details.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fx1unix%2Fchanspy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fx1unix%2Fchanspy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fx1unix%2Fchanspy/lists"}