# go: 模块要求 Go 1.22，但您的 Go 版本是 go1.20

- **ID:** `go/unsupported-go-version-in-module`
- **领域:** go
- **类别:** module_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

模块依赖需要比已安装版本更新的 Go 版本。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 1.20 | active | — | — |
| 1.21 | active | — | — |
| 1.22 | active | — | — |

## 解决方案

1. **Upgrade your Go installation to a compatible version.** (95% 成功率)
   ```
   Download and install Go 1.22 or later from golang.org/dl/.
   ```
2. **Use a older version of the module that supports your Go version.** (80% 成功率)
   ```
   Run 'go list -m -versions github.com/example/mod' and downgrade to an older version in go.mod.
   ```

## 无效尝试

- **Setting GOTOOLCHAIN to force using an older version.** — GOTOOLCHAIN only affects the toolchain selection; if the module requires a newer Go, it won't compile. (70% 失败率)
- **Removing the go directive from the dependency's go.mod.** — You cannot modify third-party modules; the requirement is enforced. (100% 失败率)
