{"id":19085889,"url":"https://github.com/gamazic/stubgen","last_synced_at":"2026-05-24T10:30:17.331Z","repository":{"id":222707593,"uuid":"758154890","full_name":"Gamazic/stubgen","owner":"Gamazic","description":"Go tool for generating stubs from interfaces","archived":false,"fork":false,"pushed_at":"2024-02-17T11:40:12.000Z","size":26,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-02T21:48:44.576Z","etag":null,"topics":["go","stubs","testing","testing-tool"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Gamazic.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-02-15T18:21:03.000Z","updated_at":"2024-02-17T09:39:02.000Z","dependencies_parsed_at":"2024-06-21T14:10:07.204Z","dependency_job_id":"1035cd8a-6914-4260-90e5-b46250f5bd38","html_url":"https://github.com/Gamazic/stubgen","commit_stats":null,"previous_names":["gamazic/stubgen"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gamazic%2Fstubgen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gamazic%2Fstubgen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gamazic%2Fstubgen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gamazic%2Fstubgen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Gamazic","download_url":"https://codeload.github.com/Gamazic/stubgen/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240137019,"owners_count":19753648,"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":["go","stubs","testing","testing-tool"],"created_at":"2024-11-09T02:57:44.004Z","updated_at":"2026-05-24T10:30:17.266Z","avatar_url":"https://github.com/Gamazic.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# stubgen\n\nA Golang library for generating interface stubs. Stubs make it easy to test a project in a table-driven style.\n\nFor an example of an easy-to-test approach, refer to the [example](./example) directory.\n\nCurrently, the `stubgen` doesn't support generic interfaces.\n\n## Installation\n\n```shell\ngo install github.com/Gamazic/stubgen@latest\n```\n\n## Example\n\nHave a Go module with the following content:\n\n`mymodule.go`\n```go\npackage testdata\n\ntype MyInterface interface {\n\tFunc(int, bool) error\n}\n\n```\n\nTo generate a stub for the file, use the command with the `--inp-file` argument:\n\n```shell\nstubgen --inp-file testdata/testfile.go\n```\n\nResult in console:\n\n```go\n// Code generated by stubgen; DO NOT EDIT.\n\npackage testdata\n\ntype StubMyInterface struct {\n\tFuncRes0 error\n}\n\nfunc (s StubMyInterface) Func(_ int, _ bool) error {\n\treturn s.FuncRes0\n}\n```\n\nAlternatively, you can provide source code from stdin:\n\n```shell\ncat mymodule.go | stubgen\n```\n\nTo save data in a file, use the `--out-file` argument:\n\n```shell\nstubgen --inp-file mymodule.go --out-file mymodule_stub.go\n```\n\nFor more examples you can check [example](./example) directory or [testdata](./testdata) directory.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgamazic%2Fstubgen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgamazic%2Fstubgen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgamazic%2Fstubgen/lists"}