{"id":24930330,"url":"https://github.com/ras0q/gotests-template","last_synced_at":"2025-07-19T12:33:54.045Z","repository":{"id":43870142,"uuid":"428126421","full_name":"ras0q/gotests-template","owner":"ras0q","description":"My template for https://github.com/cweill/gotests","archived":false,"fork":false,"pushed_at":"2024-05-30T02:53:36.000Z","size":22,"stargazers_count":2,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-09T21:51:28.494Z","etag":null,"topics":["gotests"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ras0q.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-11-15T04:49:26.000Z","updated_at":"2025-03-05T23:01:00.000Z","dependencies_parsed_at":"2023-01-25T22:31:45.781Z","dependency_job_id":null,"html_url":"https://github.com/ras0q/gotests-template","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ras0q%2Fgotests-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ras0q%2Fgotests-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ras0q%2Fgotests-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ras0q%2Fgotests-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ras0q","download_url":"https://codeload.github.com/ras0q/gotests-template/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248119402,"owners_count":21050754,"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":["gotests"],"created_at":"2025-02-02T13:54:11.215Z","updated_at":"2025-04-09T21:51:33.738Z","avatar_url":"https://github.com/ras0q.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gotests-template\n\nMy template for [cweill/gotests](https://github.com/cweill/gotests)\n\n## Usage (VSCode)\n\nAdd gotests settings to ./vscode/settings.json\n\n```txt\n{\n  ...,\n  \"go.generateTestsFlags\": [\n    \"-template_dir\",\n    \"./path/to/ras0q/gotests-template/templates\" // Or templates2\n  ],\n  ...\n}\n```\n\n## Contents\n\n### templates\n\n[example_templates_test.go](./example_templates_test.go)\n\n### templates2\n\n[example_templates2_test.go](./example_templates2_test.go)\n\n- TDD\n- Parallel test\n- Use `map[string]struct`(map key is testname)\n- Use [google/go-cmp](https://github.com/google/go-cmp)\n\n### map-gomock-gocmp-errors-setupFields\n\n[example_map-errors-gomock-gocmp_test.go](./example_map-errors-gomock-gocmp_test.go)\n\n- manage subtest names as map keys\n- initialize receiver fields with `*gomock.Controller`\n- can change to parallel test with a `-parallel` flag\n- use following packages\n  - standard `errors` package\n  - `gomock`: \u003chttps://github.com/golang/mock\u003e\n  - `go-cmp`: \u003chttps://github.com/google/go-cmp\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fras0q%2Fgotests-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fras0q%2Fgotests-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fras0q%2Fgotests-template/lists"}