{"id":21034524,"url":"https://github.com/budougumi0617/cmpmock","last_synced_at":"2025-08-16T01:17:58.651Z","repository":{"id":52581925,"uuid":"359153673","full_name":"budougumi0617/cmpmock","owner":"budougumi0617","description":"Readable \u0026 Flexible matcher for https://github.com/uber-go/mock","archived":false,"fork":false,"pushed_at":"2024-09-04T01:06:52.000Z","size":18,"stargazers_count":21,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-15T13:44:44.570Z","etag":null,"topics":["go","golang","gomock","gomock-matchers","hacktoberfest","mock","test","testing"],"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/budougumi0617.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":"2021-04-18T13:40:27.000Z","updated_at":"2025-05-11T09:19:11.000Z","dependencies_parsed_at":"2025-05-15T13:44:18.729Z","dependency_job_id":"6ae14b6e-d91f-4b74-ab40-e94e9d0e65ed","html_url":"https://github.com/budougumi0617/cmpmock","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/budougumi0617/cmpmock","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/budougumi0617%2Fcmpmock","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/budougumi0617%2Fcmpmock/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/budougumi0617%2Fcmpmock/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/budougumi0617%2Fcmpmock/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/budougumi0617","download_url":"https://codeload.github.com/budougumi0617/cmpmock/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/budougumi0617%2Fcmpmock/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270653606,"owners_count":24622795,"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-15T02:00:12.559Z","response_time":110,"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":["go","golang","gomock","gomock-matchers","hacktoberfest","mock","test","testing"],"created_at":"2024-11-19T13:07:27.507Z","updated_at":"2025-08-16T01:17:58.625Z","avatar_url":"https://github.com/budougumi0617.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cmpmock\n\n[![Go Reference](https://pkg.go.dev/badge/github.com/budougumi0617/cmpmock.svg)](https://pkg.go.dev/github.com/budougumi0617/cmpmock)\n[![MIT License](http://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](LICENSE)\n[![test](https://github.com/budougumi0617/cmpmock/workflows/test/badge.svg)](https://github.com/budougumi0617/cmpmock/actions?query=workflow%3Atest)\n[![reviewdog](https://github.com/budougumi0617/cmpmock/workflows/reviewdog/badge.svg)](https://github.com/budougumi0617/cmpmock/actions?query=workflow%3Areviewdog)\n\nReadable \u0026 Flexible matcher for `go.uber.org/mock/gomock` ( https://github.com/uber-go/mock )\n\n## Description\ncmpmock provides a simple custom matcher. it is be able to modify behavior with `github.com/google/go-cmp/cmp/cmpopts`.\n\n```go\nimport \"github.com/google/go-cmp/cmp\"\n\nfunc DiffEq(v interface{}, opts ...cmp.Option) gomock.Matcher\n```\n\nIf `DiffEq` is set no `opts`, default behavior ignores a time differences of less than a second.\n\n\n### Readable ouput\n\nDefault output\n```\nexpected call at /Users/budougumi0617/go/src/github.com/budougumi0617/cmpmock/_example/repo_test.go:26 doesn't match the argument at index 1.\nGot: \u0026{John Due Tokyo 2021-04-23 02:46:58.145696 +0900 JST m=+0.000595005}\nWant: is equal to \u0026{John Due Tokyo 2021-04-23 02:46:48.145646 +0900 JST m=-9.999455563}\n```\n\nuse `cmpmock.DiffEq`\n```\nexpected call at /Users/budougumi0617/go/src/github.com/budougumi0617/cmpmock/_example/repo_test.go:27 doesn't match the argument at index 1.\nGot: \u0026{John Due Tokyo 2021-04-23 02:46:33.290458 +0900 JST m=+0.001035665}\nWant: diff(-got +want) is   \u0026_example.User{\n \tName:     \"John Due\",\n \tAddress:  \"Tokyo\",\n- \tCreateAt: s\"2021-04-23 02:46:33.290458 +0900 JST m=+0.001035665\",\n+ \tCreateAt: s\"2021-04-23 02:46:23.290383 +0900 JST m=-9.999039004\",\n}\n```\n\n## Usage\n\n```go\ntype UserRepo interface {\n  Save(context.Context, *User) error\n}\n\nwantUser := \u0026User{}\nmrepo := mock.NewMockUserRepo(ctrl)\nmrepo.EXPECT().Save(ctx, cmpmock.DiffEq(wantUser)).Return(nil)\n```\n\n## Installation\n\n```bash\n$ go get -u github.com/budougumi0617/cmpmock\n```\n\n## License\n\n[MIT](./LICENSE)\n\n## Author\nYocihiro Shimizu(@budougumi0617)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbudougumi0617%2Fcmpmock","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbudougumi0617%2Fcmpmock","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbudougumi0617%2Fcmpmock/lists"}