【已解决】go get报错unrecognized import path “golang.org/x/net/context”…

今天安装gin框架,首先下载gin,命令如下:
go get gopkg.in/gin-gonic/gin.v1
结果报错:

package golang.org/x/net/context: unrecognized import path "golang.org/x/net/context" (https fetch: Get https://golang.org/x/net/context?go-get=1: dial tcp 216.239.37.1:443: connectex: 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.)

解决办法:
1:本身就是挂着vpn的,可以打开google,github等各种网站,就是下载不下来;
2:参考文章做了下,果然搞定,文章链接:当go get遇到墙时
操作的办法就是:

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

安装了这个net包,然后再去安装gin,就安装成功了。

文章的脚注信息由WordPress的wp-posturl插件自动生成



|2|left
打赏

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: