{"id":19684040,"url":"https://github.com/bonsai-oss/goimportssort","last_synced_at":"2026-06-11T08:31:46.594Z","repository":{"id":143651468,"uuid":"561652582","full_name":"bonsai-oss/goimportssort","owner":"bonsai-oss","description":"automatically fix the order of golang imports. Repository mirrored from GitLab. 🦊","archived":false,"fork":false,"pushed_at":"2026-05-14T07:01:16.000Z","size":74,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-05-14T08:38:53.828Z","etag":null,"topics":["golang","improvement","programming","tools"],"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/bonsai-oss.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":"2022-11-04T07:10:21.000Z","updated_at":"2026-05-14T06:58:20.000Z","dependencies_parsed_at":"2024-01-14T12:30:33.902Z","dependency_job_id":"47b225aa-c9bc-4843-b1b5-4b7afc0cb5d1","html_url":"https://github.com/bonsai-oss/goimportssort","commit_stats":null,"previous_names":["bonsai-oss/goimportsort"],"tags_count":32,"template":false,"template_full_name":null,"purl":"pkg:github/bonsai-oss/goimportssort","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bonsai-oss%2Fgoimportssort","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bonsai-oss%2Fgoimportssort/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bonsai-oss%2Fgoimportssort/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bonsai-oss%2Fgoimportssort/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bonsai-oss","download_url":"https://codeload.github.com/bonsai-oss/goimportssort/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bonsai-oss%2Fgoimportssort/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34190583,"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-06-11T02:00:06.485Z","response_time":57,"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":["golang","improvement","programming","tools"],"created_at":"2024-11-11T18:16:37.399Z","updated_at":"2026-06-11T08:31:46.573Z","avatar_url":"https://github.com/bonsai-oss.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"_fork of https://github.com/AanZee/goimportssort_\n\n# go-imports-sort \n![Gitlab code coverage](https://img.shields.io/gitlab/pipeline-coverage/bonsai-oss/tools/goimportssort?branch=master)\n![GitHub Workflow Status Build](https://img.shields.io/github/actions/workflow/status/bonsai-oss/goimportssort/go.yml?branch=master)\n![GitHub go.mod Go version](https://img.shields.io/github/go-mod/go-version/bonsai-oss/goimportssort)\n\nThis tool aims to automatically fix the order of golang imports. It will split your imports into three categories.\n\n## Features\n\n- Automatically split your imports in three categories: inbuilt, external and local.\n- Written fully in Golang, no dependencies, works on any platform.\n- Detects Go module name automatically.\n- Orders your imports alphabetically.\n- Removes additional line breaks.\n- No more manually fixing import orders.\n\n## Why use this over `goimports`?\n\nGoimports will not categorize your imports when wrongly formatted. PRs to add in the\nfunctionality [were denied](https://github.com/golang/tools/pull/68#issuecomment-450897493).\n\n## Installation\n\n```\n$ go install github.com/bonsai-oss/goimportssort@latest\n```\n\n## Usage\n\n```\nusage: goimportssort [flags] [path ...]\n  -l    write results to stdout\n  -local string\n        put imports beginning with this string after 3rd-party packages; comma-separated list\n  -o string\n        custom the order of the section of imports. e.g. ixl means inbuilt, external, and local (default \"iel\")\n  -p int\n        number of files to process concurrently (default 8)\n  -v    verbose logging\n  -w    write result to (source) file instead of stdout\n```\n\nImports will be sorted according to their categories.\n\n```\n$ goimportssort -v -w .\n```\n\nFor example:\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\tAPZ \"bitbucket.org/example/package/name\"\n\tAPA \"bitbucket.org/example/package/name\"\n\t\"github.com/bonsai-oss/goimportssort/package2\"\n\t\"github.com/bonsai-oss/goimportssort/package1\"\n)\nimport (\n\t\"net/http/httptest\"\n)\n\nimport \"bitbucket.org/example/package/name2\"\nimport \"bitbucket.org/example/package/name3\"\nimport \"bitbucket.org/example/package/name4\"\n```\n\nwill be transformed into:\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\t\"net/http/httptest\"\n\n\tAPA \"bitbucket.org/example/package/name\"\n\tAPZ \"bitbucket.org/example/package/name\"\n\t\"bitbucket.org/example/package/name2\"\n\t\"bitbucket.org/example/package/name3\"\n\t\"bitbucket.org/example/package/name4\"\n\n\t\"github.com/bonsai-oss/goimportssort/package1\"\n\t\"github.com/bonsai-oss/goimportssort/package2\"\n)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbonsai-oss%2Fgoimportssort","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbonsai-oss%2Fgoimportssort","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbonsai-oss%2Fgoimportssort/lists"}