Go get unrecognized import path "gopkg.in/yaml.v2"

安装gin:

go get -u github.com/gin-gonic/gin

出现错误:

package gopkg.in/yaml.v2: unrecognized import path "gopkg.in/yaml.v2" (https fetch: Get https://gopkg.in/yaml.v2?go-get=1: net/http: TLS handshake timeout)

如图所示:

尝试使用网上的解决方式:

1:

git config  --global   http.sslVerify "false"

2:

git config --global http.postBuffer 524288000

3:

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

再次go get 下载然并卵,至少我的还是不行,所以果断放弃go get ,直接找到github上的源码地址(在src 目录下 创建 gopkg.in 目录,执行如下命令)

git clone https://github.com/go-yaml/yaml.git 

把yaml 重命名为yaml.v2 ,然后在执行  go install,如图:

OK,到此安装完毕!

 

你可能感兴趣的:(Go get unrecognized import path "gopkg.in/yaml.v2")