{"id":31465531,"url":"https://github.com/adamshannag/goant","last_synced_at":"2026-07-01T02:31:20.411Z","repository":{"id":312307071,"uuid":"1047057161","full_name":"AdamShannag/goant","owner":"AdamShannag","description":"run command line tools based on go annotations","archived":false,"fork":false,"pushed_at":"2025-08-30T17:23:45.000Z","size":23,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-01T17:43:42.197Z","etag":null,"topics":["annotations","go","tool"],"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/AdamShannag.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-08-29T17:06:44.000Z","updated_at":"2025-08-30T17:23:48.000Z","dependencies_parsed_at":"2025-08-29T19:53:36.286Z","dependency_job_id":"bffba020-a8a3-417c-8c67-cfa51931ae15","html_url":"https://github.com/AdamShannag/goant","commit_stats":null,"previous_names":["adamshannag/goant"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/AdamShannag/goant","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AdamShannag%2Fgoant","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AdamShannag%2Fgoant/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AdamShannag%2Fgoant/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AdamShannag%2Fgoant/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AdamShannag","download_url":"https://codeload.github.com/AdamShannag/goant/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AdamShannag%2Fgoant/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34990845,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-01T02:00:05.325Z","response_time":130,"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":["annotations","go","tool"],"created_at":"2025-10-01T17:29:37.669Z","updated_at":"2026-07-01T02:31:20.404Z","avatar_url":"https://github.com/AdamShannag.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Goant\n\nGoant is a lightweight tool for scanning Go projects for annotated types or interfaces and running commands dynamically\nbased on those annotations. It works with any tool that can be triggered from the command line.\n\n\u003cp\u003e\n  \u003ca href=\"https://github.com/AdamShannag/goant/actions/workflows/build.yml\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/actions/workflow/status/AdamShannag/goant/build.yml?branch=master\u0026label=CI%2FCD\u0026logo=github\" alt=\"CI/CD\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/AdamShannag/goant/blob/master/go.mod\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/go-mod/go-version/AdamShannag/goant?logo=go\" alt=\"Go Version\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/AdamShannag/goant/releases/latest\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/v/release/AdamShannag/goant?sort=semver\" alt=\"Latest Release\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/AdamShannag/goant/blob/master/LICENSE\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" alt=\"License: MIT\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n## Installation\n\nYou can install and run Goant in two ways:\n\n### 1. Install via `go install`\n\n```bash\ngo install github.com/AdamShannag/goant/cmd/goant@v0.3.0\n```\n\nThen run it directly:\n\n```bash\ngoant -keyword=myAnnotation -cmd=\"your command here\"\n```\n\n### 2. Run directly with `go run`\n\n```bash\ngo run github.com/AdamShannag/goant/cmd/goant@v0.3.0 -keyword=myAnnotation -cmd=\"your command here\"\n```\n\n## Flags\n\n* `-root` – Root directory to start scanning Go files (default: `.`).\n* `-keyword` – Comment keyword to search for, e.g. `gomock`.\n* `-cmd` – Command template with placeholders.\n* `-dry` – Print the commands that would be executed without actually running them.\n* `-s` – Suppress all output.\n* `-skip` – Comma-separated list of directories to skip.\n* `-version` – Print Goant version and exit.\n\n## Example\n\nSuppose you have an interface annotated like this:\n\n```go\n// gomock:package=user_mock out=.gen/mocks/user_mock/mock_repo.go\ntype Repository interface {\n    Create(ctx context.Context, user domain.User) (domain.User, error)\n}\n\n```\n\nRun Goant:\n\n```bash\ngoant -keyword=gomock -cmd=\"go run go.uber.org/mock/mockgen@v0.1.0 -destination=@out -package=@package -source=@path @type\"\n```\n\nGoant will substitute placeholders:\n\n* `@out` → `.gen/mocks/user_mock/mock_repo.go`\n* `@package` → `user_mock`\n* `@path` → `./internal/repository/user/repository.go`\n* `@type` → `Repository`\n\nAnd then execute the generated command.\n\n## Placeholders\n\n### Automatic placeholders\n\nThese are resolved automatically by Goant:\n\n- `@path` – Relative path to the Go file.\n- `@type` – Name of the type.\n\n### Custom placeholders\n\nAny additional parameters provided in the annotation are also available as placeholders.\nFor example, if your annotation includes out=... and package=..., then @out and @package become available in the command\ntemplate.\n\nYou are free to define any parameter names in the annotation, and Goant will substitute\nthem accordingly.\n\n## Multiple Annotations\n\nGoant supports having **multiple annotations on a single type or interface**. Each annotation is independent and can be\nassociated with different tools or commands. You can also repeat the **same annotation keyword** with different\nparameters. In this case, Goant will run each\nannotation separately using its respective parameters.\n\nExample:\n\n```go\n// gomock:package=user_mock out=.gen/mocks/user_mock/mock_repo.go\n// myTool:echo=hello\n// myTool:echo=world\ntype Repository interface {\n    Create(ctx context.Context, user domain.User) (domain.User, error)\n}\n\n```\n\n* The first annotation uses the `gomock` keyword with parameters for mock generation.\n* The second and third annotations both use the `myTool` keyword but with different `echo` values. Goant will run **each\n  annotation separately**, substituting the appropriate parameters.\n\nThis allows you to define multiple commands for the same type, either using **different keywords** or the **same keyword\nwith different parameter sets**.\n\n## License\n\n[MIT](LICENSE)\n\n## Contribution\n\nContributions are welcome! If you have ideas, bug reports, or improvements, please open an issue or submit a pull\nrequest.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadamshannag%2Fgoant","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadamshannag%2Fgoant","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadamshannag%2Fgoant/lists"}