0


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

编译成功。


本文转载自: https://blog.csdn.net/weixin_39997829/article/details/131814911
版权归原作者 安全大哥 所有, 如有侵权,请联系我们删除。

“go环境下载github文件显示timeout解决方法”的评论:

还没有评论