{"id":15755625,"url":"https://github.com/hmarr/pkgextract","last_synced_at":"2025-06-26T22:35:47.897Z","repository":{"id":57529352,"uuid":"153951064","full_name":"hmarr/pkgextract","owner":"hmarr","description":"Extract a set of Go packages that depend on one another","archived":false,"fork":false,"pushed_at":"2019-02-27T14:56:54.000Z","size":2,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-05T05:40:48.593Z","etag":null,"topics":[],"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/hmarr.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":"2018-10-20T21:44:49.000Z","updated_at":"2023-11-13T09:00:00.000Z","dependencies_parsed_at":"2022-08-26T03:51:26.474Z","dependency_job_id":null,"html_url":"https://github.com/hmarr/pkgextract","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/hmarr/pkgextract","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hmarr%2Fpkgextract","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hmarr%2Fpkgextract/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hmarr%2Fpkgextract/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hmarr%2Fpkgextract/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hmarr","download_url":"https://codeload.github.com/hmarr/pkgextract/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hmarr%2Fpkgextract/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262151861,"owners_count":23266929,"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":[],"created_at":"2024-10-04T08:22:37.978Z","updated_at":"2025-06-26T22:35:47.859Z","avatar_url":"https://github.com/hmarr.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pkgextract\n\nA library for extracting a set of Go packages that depend on one another.\n\n## Example\n\nExtract the `cmd/go/internal/modload` package from [golang/go](https://github.com/golang/go), along with all the package it depends on, replacing `internal` with `_internal_` in import paths.\n\n```go\npackage main\n\nimport (\n\t\"log\"\n\t\"path/filepath\"\n\t\"strings\"\n\n\t\"github.com/hmarr/pkgextract\"\n)\n\nfunc main() {\n\textractor := pkgextract.NewPackageExtractor(pkgextract.PackageExtractorOptions{\n\t\tInitialPkg: \"cmd/go/internal/modload\",\n\t\tOutputRoot: \"./out\",\n\t\tImportRewriter: func(importPath string) string {\n\t\t\tnewPath := strings.Replace(importPath, \"internal\", \"_internal_\", -1)\n\t\t\treturn filepath.Join(\"github.com/dependabot/gomodules-extracted\", newPath)\n\t\t},\n\t\tFilter: func(importPath string) bool {\n\t\t\treturn strings.Contains(importPath, \"internal\")\n\t\t},\n\t})\n\n\tif err := extractor.Run(); err != nil {\n\t\tlog.Fatal(err)\n\t}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhmarr%2Fpkgextract","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhmarr%2Fpkgextract","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhmarr%2Fpkgextract/lists"}