Golang solves go get github.com/xxxx dependent package dial tcp i/o timeout

Table of contents

Problem reporting error:

problem causes:

Solution:

Several common GOPROXY


Problem reporting error:

go get github.com/spf13/cobra
go: module github.com/spf13/cobra: Get "https://proxy.golang.org/github.com/spf13/cobra/@v/list": dial tcp 142.251.42.241:443: i/o timeout

problem causes:

The reason for the problem should be that it is blocked, or there is no effective GOPROXY configured, so the dependent package cannot be downloaded

Solution:

You can configure the available GOPROXY in the environment variable

My configuration is as follows:

export GO111MODULE=on
export GOPROXY="https://goproxy.cn,direct"

After configuration, source your environment variable configuration file to take effect

There is also the more common GOPROXY, try a few more times to see if it is possible

Several common GOPROXY

export GOPROXY=https://mirrors.aliyun.com/goproxy/

export GOPROXY=https://goproxy.cn

export GOPROXY=https://gonexus.dev,direct

export GOPROXY=https://goproxy.io/,direct

export GOPROXY=https://athens.azurefd.net,direct

Guess you like

Origin blog.csdn.net/u011285281/article/details/127442338