安裝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. ...
安裝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,到此安裝完畢!