{"id":26849595,"url":"https://github.com/reflog/struct2interface","last_synced_at":"2025-05-04T08:41:02.605Z","repository":{"id":57511037,"uuid":"238664147","full_name":"reflog/struct2interface","owner":"reflog","description":"CLI Tool to extract an Interface from a Golang struct using AST","archived":false,"fork":false,"pushed_at":"2020-04-08T10:00:06.000Z","size":21,"stargazers_count":20,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-04T03:34:47.950Z","etag":null,"topics":["ast","go","refactoring","struct"],"latest_commit_sha":null,"homepage":null,"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/reflog.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}},"created_at":"2020-02-06T10:36:33.000Z","updated_at":"2024-04-30T23:55:14.000Z","dependencies_parsed_at":"2022-09-26T16:30:59.205Z","dependency_job_id":null,"html_url":"https://github.com/reflog/struct2interface","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reflog%2Fstruct2interface","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reflog%2Fstruct2interface/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reflog%2Fstruct2interface/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reflog%2Fstruct2interface/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/reflog","download_url":"https://codeload.github.com/reflog/struct2interface/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252310936,"owners_count":21727512,"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":["ast","go","refactoring","struct"],"created_at":"2025-03-30T21:36:47.126Z","updated_at":"2025-05-04T08:41:02.583Z","avatar_url":"https://github.com/reflog.png","language":"Go","readme":"# struct2interface\n\nstruct2interface is a CLI utility to extract an interface from a Golang struct\n\n## Installation\n\n```bash\ngo get github.com/reflog/struct2interface\n```\n\n## Usage\n\n```bash\nstruct2interface --help\n\nUsage:\n  struct2interface [flags]\n\nFlags:\n  -f, --folder string      Path to the package in which the struct resides\n  -h, --help               help for struct2interface\n  -i, --interface string   Name of the output interface\n  -o, --output string      Path to output file (will be overwritten)\n  -p, --package string     Name of the package in which the struct resides\n  -s, --struct string      Name of the input struct\n  -t, --template string    Path to a Go template file to use for writing the resulting interface\n\nstruct2interface -f \"/home/reflog/go/src/github.com/mattermost/mattermost-server/app\" -o \"/home/reflog/go/src/github.com/mattermost/mattermost-server/\napp/app_iface.go\" -p \"app\" -s \"App\" -i \"AppIface\"\n```\n\n## Other tools\nBefore writing this, I tried the following projects, but encountered issues:\n\n[Interfacer](https://github.com/rjeczalik/interfaces) - incredibly slow, dumps odd messages to stderr and writes fully qualified package name instead of localized one, i.e. `*github.com/mattermost/mattermost-server/v5/model.Config` instead of `*model.Config`    \n[Ifacemaker](https://github.com/vburenin/ifacemaker) - created duplicate imports (in my case `\"html/template\"` and `\"text/template\"`)  \n\n## Contributing\nPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.\n\nPlease make sure to update tests as appropriate.\n\n## License\n[MIT](https://choosealicense.com/licenses/mit/)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freflog%2Fstruct2interface","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freflog%2Fstruct2interface","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freflog%2Fstruct2interface/lists"}