Home > Backend Development > Golang > About go get timeout problem

About go get timeout problem

藏色散人
Release: 2021-02-05 15:32:05
forward
4107 people have browsed it

The following is an introduction to go get timeout from the golang tutorial column, I hope it will be helpful to friends in need!

About go get timeout problem

  • Consider it a proxy problem

Set the first proxy
Proxy address

go env -w GO111MODULE=on
go env -w GOPROXY=https://goproxy.io,direct

# 设置不走 proxy 的私有仓库,多个用逗号相隔(可选)
go env -w GOPRIVATE=*.corp.example.com

# 设置不走 proxy 的私有组织(可选)
go env -w GOPRIVATE=example.com/org_name
Copy after login

No The download was successful, so using the second

proxy address

$ go env -w GO111MODULE=on
$ go env -w GOPROXY=https://goproxy.cn,direct
Copy after login

was useless. Read the error message carefully!

go get gorm.io/gorm: gorm.io/gorm@v1.20.12: verifying module: gorm.io/gorm@v1.20.12: Get "https://sum.golang.org/lookup/gorm.io/gorm@v1.20.12": dial tcp 216.58.200.49:443: co
nnectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has
failed to respond.
Copy after login

It turns out that because Go 1.13 sets the default GOSUMDB=sum.golang.org, this website is blocked. It is used to verify the validity of the package. It can be closed with the following command:

go env -w GOSUMDB=off
Copy after login

You can set

GOSUMDB="sum.golang.google.cn"
Copy after login

, which is a sum verification service specially provided for China.

goenv-w GOSUMDB="sum.golang.google.cn
Copy after login

-w flag requires one or more parameters of the form NAME=VALUE and overrides the default settings

The above is the detailed content of About go get timeout problem. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:learnku.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template