SDK下载

  • https://studygolang.com/dl

    方式1

  • 直接使用go get函数,该情况下,已经配置好go环境变量

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

    但是,使用该语句的时候,遇见超时的问题,可能是内网或者go get被墙(大概率)的原因,此方法行不通

    方法2

  • 先采用git clone方法下载gin包,再使用go install安装

  • 下载到当前终端所在路径:

    1. git clone https://github.com/gin-gonic/gin.git
  • 安装:

    1. go install github.com/gin-gonic/gin
  • 提示这两个文件夹不存在,于是依然采用git clone下载

  • 具体语句:

    1. git clone --branch v8.18.2 https://github.com/go-playground/validator.git
    2. git clone --branch v2.2.1 https://github.com/go-yaml/yaml.git
  • 然后将下载下来的包改名,分别为:

    1. gopkg.in\go-playground\validator.v8
    2. gopkg.in\yaml.v2
  • 存放到GOPATH下的

    1. src\github.com\gin-gonic\gin\vendor\gopkg.in 中
  • 具体依据错误出现的路径提示,再执行:

    1. go install github.com/gin-gonic/gin
  • 成功

    参考

  • https://blog.csdn.net/Ssxy0606/article/details/94034066