# go: 找不到提供包 github.com/foo/bar 的模块：GOPROXY=off 已禁用模块查找

- **ID:** `go/go-mod-vendor-permission-error`
- **领域:** go
- **类别:** config_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

当 GOPROXY=off 且模块不在 vendor 目录中时，go 命令无法解析该包。

## 版本兼容性

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

## 解决方案

1. **** (90% 成功率)
   ```
   Set GOPROXY to a valid proxy or direct, then run 'go mod download' or 'go mod vendor'.
   ```
2. **** (60% 成功率)
   ```
   If offline, ensure the module is already in the module cache: 'go env GOMODCACHE' and copy from another machine.
   ```

## 无效尝试

- **** — GOPROXY=off overrides this flag; module downloads are still blocked. (90% 失败率)
- **** — This is not compatible with module mode and can cause import path mismatches. (70% 失败率)
