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
 

go环境下载github文件显示timeout解决方法_第1张图片

 

2、解决方案

配置代理,命令如下:

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

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

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

编译成功。

go环境下载github文件显示timeout解决方法_第2张图片

 

你可能感兴趣的:(工具小tip,golang,github,开发语言)