In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly explains "how to solve the failure of go get download package". The explanation content in this article is simple and clear, easy to learn and understand. Please follow the ideas of Xiaobian and go deep into it to study and learn "how to solve the failure of go get download package" together!
Go get download package failure problem
Due to some force majeure reasons, timeout problems often occur when installing packages using the go get command in China. This article describes several common solutions.
Clone from github
Golang has created a mirror library on github, such as https://github.com/golang/net corresponding to https://golang.org/x/net mirror library. To download the golang.org/x/net package, you can use git clone to pull the source code file of the corresponding package after creating the directory of the package locally, as follows:
mkdir -p $GOPATH/src/golang.org/xcd $GOPATH/src/golang.org/xgit clone https://github.com/golang/net.git Use gopm
Gopm can be downloaded from a number of mirror sites at golang. org.
Install gopmgo get -u github.com/gpmgo/gopm Install third-party packages using gopm
Without the-g parameter, the dependency package will be downloaded under the.vendor directory; with the-g parameter, the dependency package can be downloaded to the GOPATH directory.
gopm get -g golang.org/x/net Use goproxy
After version 1.11 of Go, you can set the GOPROXY variable to set the proxy. If you have your own proxy server, you can set this environment variable to your proxy. First open the go module Support:
Running on Mac/Linux:
export GO111MODULE=on
Windows Platform Execution:
SET GO111MODULE=on
2019.6.10 Update: goproxy.cn
Here we take https://goproxy. cn as an example:
On Mac/Linux, you can execute the following command:
export GOPROXY=https://goproxy.cn
For Windows platforms, execute the following command in cmd to set:
SET GOPROXY="https://goproxy.cn"
Or execute in PowerShell:
C:\> $env:GOPROXY = "https://goproxy.cn" Thank you for reading, the above is "how to solve the go get download package failure" content, after the study of this article, I believe everyone on how to solve the go get download package failure This problem has a deeper understanding, the specific use of the situation also needs to be verified by practice. Here is, Xiaobian will push more articles related to knowledge points for everyone, welcome to pay attention!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.