macOS
brew install goimportslocal Homebrew formula metadata
brew
goimports のインストール経路、実行ファイル、メタデータ、AI エージェント向けセキュリティノートを確認します。
インストール
brew install goimportslocal Homebrew formula metadata
概要
Go formatter that additionally inserts import statements
履歴
goimports is a Go formatter command that also adds missing imports and removes unused imports. It is part of golang.org/x/tools, the official Go supplementary tools repository.
The command became one of the canonical editor-save tools in Go development because it turns source formatting and import maintenance into one operation.
The cmd/goimports documentation carries a 2013 Go Authors copyright notice, and repository history records goimports moving into go.tools in December 2013. Soon after, the README was renamed to doc.go, making the command documentation part of the source package.
The implementation evolved alongside Go tooling: repository history shows work on package lookup, standard-library handling, cgo exports, vendor directory support, and module-era behavior. The command remains documented through both its source directory and pkg.go.dev.
goimports was adopted through editors as much as through terminals. The official command docs include examples for Emacs and Vim, telling users to make goimports their format-on-save command.
Because it lives in x/tools rather than the core go command, goimports is a classic package-manager/editor dependency: small binary, official upstream, and installed wherever developers want import organization without manually editing import blocks.
The documented install path uses go install for golang.org/x/tools/cmd/goimports. In use, it formats code like gofmt and rewrites imports based on symbols in the file.
goimports respects $GOPATH/src/.goimportsignore, a line-oriented ignore file for directories that should not be scanned when resolving packages under GOPATH. That file is the only official fixed config-file location documented by the command.
goimports matters because it is the bridge between Go's no-bikeshedding formatting culture and the messier reality of import discovery. It made save hooks feel magical without requiring a full IDE.
For packagers, it is an example of an official subcommand distributed from a larger module. The package name is the command, but the upstream repository and release cadence are tied to golang.org/x/tools.
セキュリティ状態
goimports に一致するローカルシークレット処理マニフェストは見つかりませんでした。将来の対応で安定したパッケージ URL を使えるよう、Nucleus パッケージメタデータはここに公開されています。
エージェントに無人実行させる前に、このツールが平文の認証情報を読むか、リモート状態を書き込むか、成果物を公開するか、プラグインを起動するかを確認してください。
local files
These source-backed paths show where this package keeps local settings or durable credentials. Automic Vault can use them as review targets for secret scanning, migration, and command approval.
Config paths the tool may read or write during local use.
$GOPATH/src/.goimportsignore実行可能ファイル
| コマンド | 種類 | 公開範囲 | メモ |
|---|---|---|---|
goimports | cli | グローバル実行可能ファイル |
鮮度
これらの信号は、ページ生成時期、パッケージマネージャの活動、上流リリース比較を分けて示します。バージョン遅れは、証拠 URL と比較可能なバージョンがある場合だけ警告されます。
https://github.com/golang/tools
インストールメタデータ
| パッケージキー | brew:goimports |
|---|---|
| バージョン | 0.48.0 |
| パッケージマネージャ | Homebrew |
| パッケージマネージャページ | https://formulae.brew.sh/formula/goimports |
| ホームページ | https://pkg.go.dev/golang.org/x/tools/cmd/goimports |
| リポジトリ | https://github.com/golang/tools |
| 上流ドキュメント | https://github.com/golang/tools/tree/master/cmd/goimports |
| ライセンス | BSD-3-Clause |
| ソースアーカイブ | https://github.com/golang/tools/archive/refs/tags/v0.48.0.tar.gz |
| 最終更新 | 2026-07-09T08:38:20Z |
| Pulse | updated |
| 依存関係 | go |
| Bottle | 利用可能 (対象 arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux) |
| Homebrew post-install | 未定義 |
| サービス | 宣言なし |
レジストリ情報
| Source Database | Homebrew formula API |
|---|---|
| Tap | homebrew/core |
| Full Name | goimports |
| Version Scheme | 0 |
| Revision | 0 |
| Head Version | HEAD |
| Bottle Stable Root URL | https://ghcr.io/v2/homebrew/core |
| Deprecated | no |
| Disabled | no |
| Keg Only | no |
| URL Keys |
|
ソース経路
このページは scripts/generate-pkg-sqlite.py が生成した非公開のパッケージ SQLite アーティファクトから av-web によって提供されます。
View the package source record on GitHub.