SDK下载
-
方式1
直接使用go get函数,该情况下,已经配置好go环境变量
go get -u github.com/gin-gonic/gin
但是,使用该语句的时候,遇见超时的问题,可能是内网或者go get被墙(大概率)的原因,此方法行不通
方法2
先采用git clone方法下载gin包,再使用go install安装
下载到当前终端所在路径:
git clone https://github.com/gin-gonic/gin.git
安装:
go install github.com/gin-gonic/gin
提示这两个文件夹不存在,于是依然采用git clone下载
具体语句:
git clone --branch v8.18.2 https://github.com/go-playground/validator.gitgit clone --branch v2.2.1 https://github.com/go-yaml/yaml.git
然后将下载下来的包改名,分别为:
gopkg.in\go-playground\validator.v8gopkg.in\yaml.v2
存放到GOPATH下的
src\github.com\gin-gonic\gin\vendor\gopkg.in 中
具体依据错误出现的路径提示,再执行:
go install github.com/gin-gonic/gin
-
参考
