{"id":39416965,"url":"https://github.com/sublime-security/go-import-name-validator","last_synced_at":"2026-01-18T03:47:09.477Z","repository":{"id":57748339,"uuid":"523180558","full_name":"sublime-security/go-import-name-validator","owner":"sublime-security","description":"Enforces user defined semantics around import naming","archived":false,"fork":false,"pushed_at":"2025-03-13T13:26:16.000Z","size":17,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-12-26T21:12:06.555Z","etag":null,"topics":[],"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/sublime-security.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":"2022-08-10T02:59:37.000Z","updated_at":"2025-03-13T13:24:23.000Z","dependencies_parsed_at":"2024-06-20T02:51:41.110Z","dependency_job_id":"f96dbfd0-2f8e-4878-954d-729030d961cc","html_url":"https://github.com/sublime-security/go-import-name-validator","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/sublime-security/go-import-name-validator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sublime-security%2Fgo-import-name-validator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sublime-security%2Fgo-import-name-validator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sublime-security%2Fgo-import-name-validator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sublime-security%2Fgo-import-name-validator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sublime-security","download_url":"https://codeload.github.com/sublime-security/go-import-name-validator/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sublime-security%2Fgo-import-name-validator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28529206,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T00:39:45.795Z","status":"online","status_checked_at":"2026-01-18T02:00:07.578Z","response_time":98,"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":[],"created_at":"2026-01-18T03:47:08.831Z","updated_at":"2026-01-18T03:47:09.463Z","avatar_url":"https://github.com/sublime-security.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-import-name-validator\nEnforces user defined semantics around import naming.\n\n## Usage\n\n```\n# Install from local repo\ngo install $GOPATH/src/github.com/sublime-security/go-import-name-validator/cmd/inspect-imports\n\n# Install from GitHub\ngo install github.com/sublime-security/go-import-name-validator/cmd/inspect-imports@main\n```\n\n`inspect-imports` should be available in `$GOPATH/bin`, which is assumed to be on your `PATH`.\n\nYour working director must be the repo you're inspecting. Example to inspect a package within this repo (w/o any requirements specified):\n\n```\ncd $GOPATH/src/github.com/sublime-security/go-import-name-validator\ninspect-imports $GOPATH/src/github.com/sublime-security/go-import-name-validator/imports_analyzer\n```\n\nSimilarly to check all packages in the repo\n\n```\ncd $GOPATH/src/github.com/sublime-security/go-import-name-validator\ngo list ./... | xargs inspect-imports\n```\n\nAll standard Go singlechecker flags are supported. Such as `-fix` to fix inline, where possible.\n```\ninspect-imports -fix $GOPATH/src/github.com/sublime-security/go-import-name-validator/imports_analyzer\n```\n\n### Required Package Names\n\nThe `-require-name` flag may be specified any number of times to require that:\n* The given name is only used for the given path\n* Whenever the given path is imported, the name is used.\n\n`-require-name \u003cpath\u003e=\u003c?name\u003e`\n\nExamples:\n* `-require-name \"github.com/sirupsen/logrus\"=log`\n  * The logrus package must be imported as `log`\n  * If the name `log` is used, it must be for `\"github.com/sirupsen/logrus\"`\n* `-require-name \"errors\"=`\n  * If the errors package is imported, it must be unnamed (it cannot be named `errors`)\n\n### Forbidden Imports\n\nThe `-forbidden` flag prohibits an import path from being included, any may be specified any number of times.\n\nExamples:\n* `-forbidden github.com/RichardKnop/machinery/v2/log`\n  * `github.com/RichardKnop/machinery/v2/log` may not be imported\n  * No partial matching is supported, although this could be a good addition.\n\n### Full Examples\n\n```\ncd $GOPATH/src/github.com/sublime-security/go-import-name-validator\ngo list ./... | xargs inspect-imports -fix -forbidden github.com/RichardKnop/machinery/v2/log -require-name \"github.com/sirupsen/logrus\"=log -require-name \"errors\"=\n\n# Same but single package\ninspect-imports -fix -forbidden github.com/RichardKnop/machinery/v2/log -require-name \"github.com/sirupsen/logrus\"=log -require-name \"errors\"= $GOPATH/src/github.com/sublime-security/go-import-name-validator/imports_analyzer\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsublime-security%2Fgo-import-name-validator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsublime-security%2Fgo-import-name-validator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsublime-security%2Fgo-import-name-validator/lists"}