We’ll break down why the
import block in Go is part of the “contract” with the compiler, and how the
goimports utility removes the routine: it formats a file like
gofmt, automatically adds missing imports, removes unused ones, sorts and groups them. In practice, we’ll see how this works on the mini CLI “Tasker”, how aliases and
_-imports are supported, and how to integrate
goimports into your usual development cycle (
-w,
-l) without “noise” in the diff.