go
config_error
ai_generated
true
go: GOPROXY=off 已禁用模块查找
go: module lookup disabled by GOPROXY=off
ID: go/module-lookup-directory-error
80%修复率
90%置信度
0证据数
2024-03-05首次发现
版本兼容性
| 版本 | 状态 | 引入 | 弃用 | 备注 |
|---|---|---|---|---|
| 1.13 | active | — | — | — |
根因分析
GOPROXY 环境变量设置为 'off',禁用了所有模块下载的网络访问,但模块不在本地缓存中。
English
The GOPROXY environment variable is set to 'off', disabling all network access for module downloads, but the module is not in the local cache.
解决方案
-
95% 成功率
Set GOPROXY=https://proxy.golang.org,direct in your environment or go env -w GOPROXY=https://proxy.golang.org,direct
-
85% 成功率
If offline, use GOFLAGS=-mod=vendor and ensure all dependencies are vendored with go mod vendor beforehand.
无效尝试
常见但无效的做法:
-
40% 失败
The environment variable may be overridden by a .env file or Makefile; the shell change may not persist.
-
70% 失败
If the module is not already vendored, go mod vendor will still attempt to download it and fail.