# bradfitz/goimports

(old repo) Tool to fix (add, remove) your Go imports automatically.

Repository: https://github.com/bradfitz/goimports
Canonical: https://ross.abutalabs.com/products/goimports
Homepage: https://godoc.org/golang.org/x/tools/cmd/goimports
Language: Go
License: BSD-3-Clause
License Family: permissive
Last push: 2021-03-31T14:51:15+00:00

## Health v2 (maintenance only)
Score: 32/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 0, release rhythm 35, longevity 100
- inputs: {"age_days": 4841, "days_push": 1981, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1039, forks 77 (observed 2026-08-28T04:03:20.075030+00:00)

## What it is
goimports is a Go command-line tool that automatically fixes import lines by adding missing imports and removing unreferenced ones, while also formatting code like gofmt. This original repository has moved into the official golang.org/x/tools repo, where it continues to be maintained.

## Use cases
- automatically add missing Go imports
- remove unused imports from Go files
- format Go code on save in my editor
- replace gofmt with a tool that also fixes imports
- clean up import statements in a Go project
- integrate import fixing into vim or emacs workflow

## When to choose
- you write Go and want automatic import management plus gofmt-style formatting
- you want a gofmt-on-save hook that also fixes imports
- you want an official, actively maintained tool from golang.org/x/tools

## When to avoid
- you need a formatter for languages other than Go
- you want to contribute to this old mirror repo - PRs are no longer accepted
- you rely on non-gofmt formatting styles

## Facets
- artifact type: cli-tool
- maturity: maintenance
- function: formatter, developer-tools, cli
- domain: developer-tools, programming-languages
- platform: cli, cross-platform, go
- tags: goimports, gofmt, import-management, code-formatting, editor-integration, command-line

## Member repositories
- bradfitz/goimports (main) score 32

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:03:20.075030+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T07:03:35.594572+00:00, confidence not recorded.
  - readme: https://github.com/bradfitz/goimports (fetched 2026-08-28T04:03:20.075030+00:00, sha 659c0d2abad3)
  - homepage: https://godoc.org/golang.org/x/tools/cmd/goimports (fetched 2026-08-29T13:04:34.349421+00:00, sha bc8679fa987c)
  - site_page: https://pkg.go.dev/about (fetched 2026-08-29T13:04:34.360410+00:00, sha 757852027879)
  - site_page: https://pkg.go.dev/golang.org/x/tools/cmd/goimports (fetched 2026-08-29T13:04:34.358456+00:00, sha c32647712d95)
  - site_page: https://go.dev/project (fetched 2026-08-29T13:04:34.362275+00:00, sha d5ca00bb378b)
- Data as of 2026-08-30T08:39:29.467469+00:00.
