goland终端如何导入github上的包
例如:我们要导入gin包,最开始我直接输入go get -u github.com/gin-gonic/gin
会出现以下的问题:
# cd F:\goworkspace\src\github.com\gin-gonic\gin; git pull --ff-only
fatal: not a git repository (or any of the parent directories): .git
package github.com/gin-gonic/gin: exit status 128
然后我在终端输入go env -w GO111MODULE=on
还是无法导入gin包,出现了下面的问题:
go get github.com/gin-gonic/gin: module github.com/gin-gonic/gin: Get “https://proxy.golang.org/github.com/gin-gonic/gin/@v/list”: dial tcp 34.64.4.81:443: connectex: A connection atte
mpt 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.
之后我又输入:go env -w GOPROXY=https://goproxy.cn,direct
然后在输入go get -u github.com/gin-gonic/gin,导入成功!!!