---
title: No Unused Imports
impact: LOW
impactDescription: reduces codebase noise and compilation time
tags: imports, cleanup, maintenance, quality
---

## No Unused Imports

Unused imports increase binary size and slow down compilation. Go compiler strictly enforces this at compile time.

**Incorrect (unused imports):**

```go
package main

import (
	"fmt"
	"os"     // UNUSED
	"time"   // UNUSED
)

func main() {
	fmt.Println("Hello")
}
```

**Correct (clean imports):**

```go
package main

import (
	"fmt"
)

func main() {
	fmt.Println("Hello")
}

// Side-effect only imports use the blank identifier
import _ "net/http/pprof"
```

**Tools:** `goimports`, `golines`, Go Compiler (enforced)
