# error: mkdir /path/dir: file exists

- **ID:** `go/os-file-already-exists`
- **Domain:** go
- **Category:** io_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

Attempting to create a directory that already exists, without checking for its existence first.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 1.20 | active | — | — |
| 1.21 | active | — | — |

## Workarounds

1. **Use os.MkdirAll which does not error if exists** (98% success)
   ```
   if err := os.MkdirAll(path, 0755); err != nil { return err }
   ```

## Dead Ends

- **Ignoring error and continuing** — May lead to inconsistent state; always handle properly. (40% fail)
