# go: 模块 example.com/module：目录 "/home/user/go/pkg/mod/example.com/module@v1.0.0" 未找到

- **ID:** `go/module-directory-not-found`
- **领域:** go
- **类别:** build_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

模块缓存缺少所需的版本目录，可能是由于缓存损坏或下载不完整。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 1.11 | active | — | — |
| 1.12 | active | — | — |
| 1.13 | active | — | — |
| 1.14 | active | — | — |
| 1.15 | active | — | — |
| 1.16 | active | — | — |
| 1.17 | active | — | — |
| 1.18 | active | — | — |
| 1.19 | active | — | — |
| 1.20 | active | — | — |
| 1.21 | active | — | — |
| 1.22 | active | — | — |
| 1.23 | active | — | — |

## 解决方案

1. **Run 'go clean -modcache' and then 'go mod download'** (95% 成功率)
   ```
   go clean -modcache && go mod download
   ```
2. **Run 'go mod tidy' to re-download and verify all dependencies** (90% 成功率)
   ```
   go mod tidy
   ```

## 无效尝试

- **Manually creating the directory and copying files** — The module cache is managed by Go; manual creation leads to checksum mismatches and broken references. (90% 失败率)
- **Setting GOMODCACHE to a different path without clearing old cache** — The new path may not have the required module; the error persists if the module is not downloaded there. (60% 失败率)
