# go：github.com/foo/bar@v1.2.3：在版本 v1.2.3 读取 github.com/foo/bar/go.mod：模块未找到

- **ID:** `go/go-mod-tidy-fails-with-module-not-found`
- **领域:** go
- **类别:** module_error
- **验证级别:** ai_generated
- **修复率:** 92%

## 根因

指定的模块版本在模块代理或上游仓库中不存在，通常由于版本标签拼写错误或已删除的发布。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| go1.18 | active | — | — |
| go1.19 | active | — | — |
| go1.20 | active | — | — |

## 解决方案

1. ```
   Check available versions: go list -m -versions github.com/foo/bar; then use a valid version.
   ```
2. ```
   Use the latest version by removing @v1.2.3: go get github.com/foo/bar@latest
   ```
3. ```
   Set GONOSUMCHECK and GONOSUMDB env vars to bypass proxy restrictions: export GONOSUMCHECK=*; export GONOSUMDB=*; then go mod tidy
   ```

## 无效尝试

- **** — -e flag only suppresses error output, module still missing. (90% 失败率)
- **** — go.sum regeneration requires valid module version; missing version persists. (70% 失败率)
