# go: GOPROXY=off 已禁用模块查找

- **ID:** `go/module-lookup-directory-error`
- **领域:** go
- **类别:** config_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

GOPROXY 环境变量设置为 'off'，禁用了所有模块下载的网络访问，但模块不在本地缓存中。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 1.13 | active | — | — |

## 解决方案

1. **** (95% 成功率)
   ```
   Set GOPROXY=https://proxy.golang.org,direct in your environment or go env -w GOPROXY=https://proxy.golang.org,direct
   ```
2. **** (85% 成功率)
   ```
   If offline, use GOFLAGS=-mod=vendor and ensure all dependencies are vendored with go mod vendor beforehand.
   ```

## 无效尝试

- **** — The environment variable may be overridden by a .env file or Makefile; the shell change may not persist. (40% 失败率)
- **** — If the module is not already vendored, go mod vendor will still attempt to download it and fail. (70% 失败率)
