iris安装已经解决go get无法下载包

日落_3d9f · · 2069 次点击 · · 开始浏览    
这是一个创建于 的文章,其中的信息可能已经有所发展或是发生改变。

使用国内七牛云的 go module 镜像。

参考 https://github.com/goproxy/goproxy.cn

golang 1.13 可以直接执行:

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

阿里云 Go Module 国内镜像仓库服务

设置方法

go env -w GO111MODULE=on
go env -w GOPROXY=https://mirrors.aliyun.com/goproxy/,direct

这里我们使用代理镜像,参考goproxy。执行如下命令:

$ echo "export GO111MODULE=on" >> ~/.profile
$ echo "export GOPROXY=https://goproxy.cn" >> ~/.profile
$ source ~/.profile

之后就可以执行成功了,如下图:

$ go get  -u github.com/kataras/iris
go get github.com/kataras/iris: module github.com/kataras/iris: Get "https://goproxy.cn/github.com/kataras/iris/@v/list": dial tcp: i/o timeout
zhaoliang:iris zhaoliang$ go get  -u github.com/kataras/iris
go: downloading github.com/kataras/iris v11.1.1+incompatible
go: github.com/kataras/iris upgrade => v11.1.1+incompatible
go: downloading gopkg.in/yaml.v2 v2.2.2
go: finding module for package github.com/flosch/pongo2
go: finding module for package github.com/Joker/jade
go: finding module for package github.com/iris-contrib/formBinder
go: downloading golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5
go: downloading github.com/Joker/jade v1.0.0
go: downloading github.com/flosch/pongo2 v0.0.0-20190707114632-bbf5a6c351f4
go: downloading github.com/iris-contrib/formBinder v5.0.0+incompatible
go: found github.com/iris-contrib/formBinder in github.com/iris-contrib/formBinder v5.0.0+incompatible
go: found github.com/Joker/jade in github.com/Joker/jade v1.0.0
go: found github.com/flosch/pongo2 in github.com/flosch/pongo2 v0.0.0-20190707114632-bbf5a6c351f4
go: finding module for package github.com/gorilla/schema
go: downloading github.com/juju/errors v0.0.0-20181118221551-089d3ea4e4d5
go: downloading github.com/gorilla/schema v1.1.0
go: found github.com/gorilla/schema in github.com/gorilla/schema v1.1.0
go: github.com/modern-go/reflect2 upgrade => v1.0.1
go: github.com/modern-go/concurrent upgrade => v0.0.0-20180306012644-bacd9c7ef1dd
go: golang.org/x/text upgrade => v0.3.2
go: github.com/juju/errors upgrade => v0.0.0-20200330140219-3fe23663418f
go: golang.org/x/net upgrade => v0.0.0-20200501053045-e0ff5e5a1de5
go: golang.org/x/crypto upgrade => v0.0.0-20200429183012-4b2356b1ed79
go: gopkg.in/yaml.v2 upgrade => v2.2.8
go: golang.org/x/sys upgrade => v0.0.0-20200501052902-10377860bb8e
go: downloading golang.org/x/crypto v0.0.0-20200429183012-4b2356b1ed79
go: downloading gopkg.in/yaml.v2 v2.2.8
go: downloading github.com/juju/errors v0.0.0-20200330140219-3fe23663418f
go: downloading golang.org/x/sys v0.0.0-20200501052902-10377860bb8e
go: downloading golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5
go: downloading github.com/modern-go/reflect2 v1.0.1
go: downloading github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd

----------------------以上写的iris程序仍然无非响应-----------------------

具体解决方案看01


有疑问加站长微信联系(非本文作者)

本文来自:简书

感谢作者:日落_3d9f

查看原文:iris安装已经解决go get无法下载包

入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:701969077

2069 次点击  
加入收藏 微博
下一篇:5-1
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传