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

1、问题背景

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

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

编译过程中报错如下:

pkg/runner/runner.go:19:2: github.com/miekg/dns@v1.1.53: 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/errors@v0.9.1: 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/blackrock@v0.0.1: 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/clistats@v0.0.15: 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/dnsx@v1.1.4: 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/fdmax@v0.0.4: 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/goflags@v0.1.8: 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/gologger@v1.1.8: 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/gologger@v1.1.8: 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/gologger@v1.1.8: 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/mapcidr@v1.1.1: 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/mapcidr@v1.1.1: 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

编译成功。

相关推荐
GuYue.bing8 分钟前
网络下载ts流媒体
开发语言·python
StringerChen15 分钟前
Qt ui提升窗口的头文件找不到
开发语言·qt
木心20 分钟前
Git基本操作快速入门(30min)
git·github
数据小爬虫@21 分钟前
如何利用PHP爬虫获取速卖通(AliExpress)商品评论
开发语言·爬虫·php
一个不秃头的 程序员43 分钟前
代码加入SFTP JAVA ---(小白篇3)
java·python·github
逸_1 小时前
dify工作流+github actions实现翻译并创建PR
gpt·github·dify
java1234_小锋1 小时前
MyBatis如何处理延迟加载?
java·开发语言
FeboReigns1 小时前
C++简明教程(10)(初识类)
c语言·开发语言·c++
学前端的小朱1 小时前
处理字体图标、js、html及其他资源
开发语言·javascript·webpack·html·打包工具
摇光932 小时前
js高阶-async与事件循环
开发语言·javascript·事件循环·宏任务·微任务