解决go get无法下载被墙的包

栏目: Go · 发布时间: 7年前

内容简介:2、使用镜像仓库golang 在 github 上建立了一个镜像库,如

1、使用gopm代替 go 下载

//使用gopm(Go Package Manager)代替go下载,是go上的包管理工具,十分好用
//1. 下载安装gopm
go get -u github.com/gpmgo/gopm
//2. 使用gopm安装被墙的包
gopm get github.com/Shopify/sarama

2、使用镜像仓库

golang 在 github 上建立了一个镜像库,如 https://github.com/golang/net 即是 https://golang.org/x/net 的镜像库.获取 golang.org/x/net 包(其他包类似),其实只需要以下步骤:

mkdir -p $GOPATH/src/golang.org/x
cd $GOPATH/src/golang.org/x
git clone https://github.com/golang/net.git

3、使用国内网站打包

使用国内网站打包好,然后下载打包好的压缩包解压安装到本地

https://www.golangtc.com/download/package
1.在上诉网站里按照提示下载这个包,并解压到本地文件夹
2.在goland IDE的terminal里进行go install cloud.google.com/go/storage
3.第二步会报错,提示有些包在指定路径没找到,于是按照提示给的链接再在第一步的网站里找到并下载,按照路径放在对应的文件夹内
4.所有提示缺少的包都装好以后就可以顺利的install了。

以上所述就是小编给大家介绍的《解决go get无法下载被墙的包》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Introduction to the Design and Analysis of Algorithms

Introduction to the Design and Analysis of Algorithms

Anany Levitin / Addison Wesley / 2006-2-24 / USD 122.00

Based on a Based on a new classification of algorithm design techniques and a clear delineation of analysis methods, "Introduction to the Design and Analysis of Algorithms" presents the subject in a c......一起来看看 《Introduction to the Design and Analysis of Algorithms》 这本书的介绍吧!

HTML 压缩/解压工具
HTML 压缩/解压工具

在线压缩/解压 HTML 代码

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具