# error: remove /tmp/dir: directory not empty

- **ID:** `go/os-dir-not-empty`
- **Domain:** go
- **Category:** io_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

尝试使用 os.Remove 删除非空目录，但该函数只支持删除空目录。

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 1.19 | active | — | — |

## Workarounds

1. **** (95% success)
   ```
   使用 os.RemoveAll 并检查返回值
   ```
2. **** (90% success)
   ```
   遍历目录并递归删除所有内容
   ```

## Dead Ends

- **** — RemoveAll 可能部分删除，忽略错误导致状态不一致 (60% fail)
- **** — 子目录递归未处理 (80% fail)
