{"id":20013057,"url":"https://github.com/raeperd/recvcheck","last_synced_at":"2025-05-04T21:31:50.472Z","repository":{"id":256783638,"uuid":"856412462","full_name":"raeperd/recvcheck","owner":"raeperd","description":"Golang linter checks for receiver type consistency","archived":false,"fork":false,"pushed_at":"2025-01-18T16:35:14.000Z","size":23,"stargazers_count":6,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-05-04T17:46:23.662Z","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/raeperd.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-09-12T14:34:06.000Z","updated_at":"2025-04-22T19:57:00.000Z","dependencies_parsed_at":null,"dependency_job_id":"afabf49e-dcf7-4c00-9690-975c67416d4f","html_url":"https://github.com/raeperd/recvcheck","commit_stats":null,"previous_names":["raeperd/recvcheck"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raeperd%2Frecvcheck","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raeperd%2Frecvcheck/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raeperd%2Frecvcheck/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raeperd%2Frecvcheck/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/raeperd","download_url":"https://codeload.github.com/raeperd/recvcheck/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252404223,"owners_count":21742515,"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":"2024-11-13T07:34:34.949Z","updated_at":"2025-05-04T21:31:50.466Z","avatar_url":"https://github.com/raeperd.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# recvcheck\n[![.github/workflows/build.yaml](https://github.com/raeperd/recvcheck/actions/workflows/build.yaml/badge.svg)](https://github.com/raeperd/recvcheck/actions/workflows/build.yaml) [![Go Report Card](https://goreportcard.com/badge/github.com/raeperd/recvcheck)](https://goreportcard.com/report/github.com/raeperd/recvcheck) [![Coverage Status](https://coveralls.io/repos/github/raeperd/recvcheck/badge.svg?branch=ci-coverall)](https://coveralls.io/github/raeperd/recvcheck?branch=ci-coverall)   \nGolang linter for check receiver type in method \n\n## Motivation\nFrom [Go Wiki: Go Code Review Comments - The Go Programming Language](https://go.dev/wiki/CodeReviewComments#receiver-type)\n\u003e Don’t mix receiver types. Choose either pointers or struct types for all available method\n\nFollowing code from [Dave Cheney](https://dave.cheney.net/2015/11/18/wednesday-pop-quiz-spot-the-race) causes data race. Could you find it?\nThis linter does it for you.\n\n```go\npackage main\n\nimport (\n        \"fmt\"\n        \"time\"\n)\n\ntype RPC struct {\n        result int\n        done   chan struct{}\n}\n\nfunc (rpc *RPC) compute() {\n        time.Sleep(time.Second) // strenuous computation intensifies\n        rpc.result = 42\n        close(rpc.done)\n}\n\nfunc (RPC) version() int {\n        return 1 // never going to need to change this\n}\n\nfunc main() {\n        rpc := \u0026RPC{done: make(chan struct{})}\n\n        go rpc.compute()         // kick off computation in the background\n        version := rpc.version() // grab some other information while we're waiting\n        \u003c-rpc.done               // wait for computation to finish\n        result := rpc.result\n\n        fmt.Printf(\"RPC computation complete, result: %d, version: %d\\n\", result, version)\n}\n```\n\n## References\n- [Is there a way to detect following data race code using golangci-lint or other linter?? · golangci/golangci-lint · Discussion #5006](https://github.com/golangci/golangci-lint/discussions/5006)\n    - [Wednesday pop quiz: spot the race | Dave Cheney](https://dave.cheney.net/2015/11/18/wednesday-pop-quiz-spot-the-race)\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraeperd%2Frecvcheck","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fraeperd%2Frecvcheck","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraeperd%2Frecvcheck/lists"}