go环境下载github文件显示timeout解决方法

1、问题背景

go环境正常,需要去github拉取一个资源进行编译

go build -v -o naabu cmd/naabu/main.go

编译过程中报错如下:

pkg/runner/runner.go:19:2: github.com/miekg/[email protected]: Get "https://proxy.golang.org/github.com/miekg/dns/@v/v1.1.53.zip": dial tcp 142.251.43.17:443: i/o timeout

pkg/runner/nmap.go:10:2: github.com/pkg/[email protected]: Get "https://proxy.golang.org/github.com/pkg/errors/@v/v0.9.1.zip": dial tcp 142.251.43.17:443: i/o timeout

pkg/runner/runner.go:21:2: github.com/projectdiscovery/[email protected]: Get "https://proxy.golang.org/github.com/projectdiscovery/blackrock/@v/v0.0.1.zip": dial tcp 142.251.43.17:443: i/o timeout

pkg/runner/runner.go:22:2: github.com/projectdiscovery/[email protected]: Get "https://proxy.golang.org/github.com/projectdiscovery/clistats/@v/v0.0.15.zip": dial tcp 142.251.43.17:443: i/o timeout

pkg/runner/runner.go:23:2: github.com/projectdiscovery/[email protected]: Get "https://proxy.golang.org/github.com/projectdiscovery/dnsx/@v/v1.1.4.zip": dial tcp 142.251.43.17:443: i/o timeout

cmd/naabu/main.go:4:2: github.com/projectdiscovery/[email protected]: Get "https://proxy.golang.org/github.com/projectdiscovery/fdmax/@v/v0.0.4.zip": dial tcp 142.251.43.17:443: i/o timeout

pkg/runner/healthcheck.go:9:2: github.com/projectdiscovery/[email protected]: Get "https://proxy.golang.org/github.com/projectdiscovery/goflags/@v/v0.1.8.zip": dial tcp 142.251.43.17:443: i/o timeout

cmd/naabu/main.go:5:2: github.com/projectdiscovery/[email protected]: Get "https://proxy.golang.org/github.com/projectdiscovery/gologger/@v/v1.1.8.zip": dial tcp 142.251.43.17:443: i/o timeout

pkg/runner/validate.go:17:2: github.com/projectdiscovery/[email protected]: Get "https://proxy.golang.org/github.com/projectdiscovery/gologger/@v/v1.1.8.zip": dial tcp 142.251.43.17:443: i/o timeout

pkg/runner/validate.go:18:2: github.com/projectdiscovery/[email protected]: Get "https://proxy.golang.org/github.com/projectdiscovery/gologger/@v/v1.1.8.zip": dial tcp 142.251.43.17:443: i/o timeout

pkg/runner/runner.go:25:2: github.com/projectdiscovery/[email protected]: Get "https://proxy.golang.org/github.com/projectdiscovery/mapcidr/@v/v1.1.1.zip": dial tcp 142.251.43.17:443: i/o timeout

pkg/runner/targets.go:13:2: github.com/projectdiscovery/[email protected]: Get "https://proxy.golang.org/github.com/projectdiscovery/mapcidr/@v/v1.1.1.zip": dial tcp 142.251.43.17:443: i/o timeout

2、解决方案

配置代理,命令如下:

go env -w GOPROXY=https://goproxy.cn

然后再继续使用go命令去编译即可。

go build -v -o naabu cmd/naabu/main.go

编译成功。

相关推荐
旧识君2 分钟前
移动端1px终极解决方案:Sass混合宏工程化实践
开发语言·前端·javascript·前端框架·less·sass·scss
郝YH是人间理想19 分钟前
OpenCV基础——傅里叶变换、角点检测
开发语言·图像处理·人工智能·python·opencv·计算机视觉
Tiger Z22 分钟前
R 语言科研绘图第 36 期 --- 饼状图-基础
开发语言·程序人生·r语言·贴图
@BreCaspian31 分钟前
生成 SSH Key 并配置 GitHub/GitLab 详细教程
ssh·gitlab·github
揣晓丹31 分钟前
JAVA实战开源项目:校园失物招领系统(Vue+SpringBoot) 附源码
java·开发语言·vue.js·spring boot·开源
霍徵琅1 小时前
Groovy语言的物联网
开发语言·后端·golang
uhakadotcom1 小时前
阿里云Tea OpenAPI:简化Java与阿里云服务交互
后端·面试·github
独好紫罗兰1 小时前
洛谷题单3-P1420 最长连号-python-流程图重构
开发语言·python·算法
kingmax542120081 小时前
深入解析:使用Python爬取Bilibili视频
开发语言·python·音视频
申雪菱2 小时前
Scheme语言的数据挖掘
开发语言·后端·golang