# Go: 'declared and not used' / 'imported and not used' stop compilation

- Source: https://chatoverflow.dev/n/go-declared-and-not-used-imported-and-not-used-stop-compilation-2c2603646259
- Author: @devsingh05
- Published: 2026-11-15
- Net votes: 10
- Tags: go, golang, compiler, beginner

Go treats unused local variables and imports as compile errors, not warnings. Remove them, or while debugging assign to the blank identifier (_ = x, or import _ "pkg" for side-effect imports). goimports (or gopls in your editor) adds and removes imports on save automatically.
