{"id":43056527,"url":"https://github.com/alexisvisco/gwd","last_synced_at":"2026-01-31T11:08:05.134Z","repository":{"id":44341740,"uuid":"215562172","full_name":"alexisvisco/gwd","owner":"alexisvisco","description":"Allow to track when a module and package change from a git tree and modules which import them, ideal for monorepo !","archived":false,"fork":false,"pushed_at":"2024-09-23T08:29:05.000Z","size":1134,"stargazers_count":19,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-20T13:54:41.872Z","etag":null,"topics":["go","go118","golang","gotest","goworkspace","monorepo","tools"],"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/alexisvisco.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":"2019-10-16T13:59:50.000Z","updated_at":"2024-09-23T08:28:39.000Z","dependencies_parsed_at":"2022-07-16T02:46:23.654Z","dependency_job_id":null,"html_url":"https://github.com/alexisvisco/gwd","commit_stats":null,"previous_names":["alexisvisco/gta"],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/alexisvisco/gwd","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexisvisco%2Fgwd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexisvisco%2Fgwd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexisvisco%2Fgwd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexisvisco%2Fgwd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alexisvisco","download_url":"https://codeload.github.com/alexisvisco/gwd/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexisvisco%2Fgwd/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28939607,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-31T10:18:23.202Z","status":"ssl_error","status_checked_at":"2026-01-31T10:18:22.693Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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","go118","golang","gotest","goworkspace","monorepo","tools"],"created_at":"2026-01-31T11:08:05.082Z","updated_at":"2026-01-31T11:08:05.129Z","avatar_url":"https://github.com/alexisvisco.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"### What is this tool for ?\n\ngwd stands for go workspace diff\n\n**This is tool must be used with a go workspace file (go.work) introduced in the 1.18 release of go.**\n\nIt allows you to easily track :\n- when a module change\n- when packages of a module change and packages that import them\n\nAs an example, suppose a change is committed which modifies a package, libs/hypervisor. \nSuppose this package is imported by another package, services/controller.\ngwd is used to inspect your files based on a list of changes and determine that both of these packages must be tested, although only the first package was changed.\n\nIf you think you've already read that, it's true. This excerpt comes from the blog of digitalocean in which they talk about [the organization of their monorepository](https://blog.digitalocean.com/cthulhu-organizing-go-code-in-a-scalable-repo/).\n\n### Install\n\n```\ngo install github.com/alexisvisco/gwd@latest \n```\n\n### Commands\n\nDo `gwd --help` to see the list of commands and their usage.\n\n#### gwd --stdin \n\nThis command is used to determine which modules changed based on a list of file change provided in stdin.\n\n!Example:\n```bash\n$ cat go.work                 \ngo 1.18\n\nuse (\n        ./services/competition-vacuum\n        ./services/dummy\n        ./services/vote\n)\n\n$ git diff 2022.0728.1850 --name-only | cat\n.gitlab-ci.yml\n.gitlab-ci/get-previous-ref.sh\nMakefile\nMakefile.common\nservices/competition-vacuum/cmd/competition-vacuum/main.go\nservices/competition-vacuum/internal/clients/kkbb/client.go\nservices/competition-vacuum/internal/clients/kkbb/types.go\nservices/competition-vacuum/internal/clients/ulule/client.go\nservices/competition-vacuum/internal/services/competition_vacuum/vacuum.go\ntools/deploy.sh\n\n$ git diff 2022.0728.1850 --name-only | gwd --stdin\nservices/competition-vacuum\n\n$ git diff 2022.0728.1850 --name-only | gwd --stdin -v\n\"miimosa.com/services/competition-vacuum\":\n - \"services/competition-vacuum/internal/clients/ulule/client.go\"\n   imported by:\n   ∟ \"miimosa.com/services/competition-vacuum/cmd/competition-vacuum\" (1 times) module \"miimosa.com/services/competition-vacuum\"\n - \"services/competition-vacuum/internal/services/competition_vacuum/vacuum.go\"\n   imported by:\n   ∟ \"miimosa.com/services/competition-vacuum/cmd/competition-vacuum\" (1 times) module \"miimosa.com/services/competition-vacuum\"\n - \"services/competition-vacuum/cmd/competition-vacuum/main.go\"\n - \"services/competition-vacuum/internal/clients/kkbb/client.go\"\n   imported by:\n   ∟ \"miimosa.com/services/competition-vacuum/cmd/competition-vacuum\" (1 times) module \"miimosa.com/services/competition-vacuum\"\n```\n\nAs you can see only \"miimosa.com/services/competition-vacuum\" has been changed.\n\nThis command can take one argument, if it is specified it will show only diff for packages in the module specified.\n\n#### check\n\nThis command is used to check if a module from the go workspace has change.\nThis command takes one argument, the name of the module, it can be a path or a module name.\n\n### Flags \nEach of theses commands have in common 2 flags:\n\n- `--stdin` read stdin, used in conjuncture with git diff --name-only for example.\n- `--file` read a file, each line must be a file path\n\n#### Global flags\n\n- `--json or -j` output commands as json\n- `--verbose or -v` output commands with more details that the default output\n- `--go-work or -w` set the go workspace file name which is by default parsed from the the go.mod file\n\n \n#### Why using a pkg folder ?\n\nI don't use internal for open source because maybe you will use some packages for your usage.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexisvisco%2Fgwd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexisvisco%2Fgwd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexisvisco%2Fgwd/lists"}