Gin框架安装记录

框架被玩坏了。。重新搭一遍环境

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

(1)下载到当前终端所在路径:git clone https://github.com/gin-gonic/gin.git
(2)安装:go install github.com/gin-gonic/gin

得到报错,需要安装模块(这里忘截图了,另外找的)
在这里插入图片描述
使用语句:

git clone --branch v8.18.2 https://github.com/go-playground/validator.git
git clone --branch v2.2.1 https://github.com/go-yaml/yaml.git

下载后存放到GOPATH下的

src\github.com\gin-gonic\gin\vendor\gopkg.in

其中两个下下来的包都需要改名

改名后路径应该是这样的:

gopkg.in\go-playground\validator.v8
gopkg.in\yaml.v2

再执行:go install github.com/gin-gonic/gin
又是一次报错:
在这里插入图片描述
根据提示,创建目录 c:\go\src\google.golang.org\

并在新创建的目录中使用git clone命令:

git clone https://github.com/protocolbuffers/protobuf-go.git

下下来后名字是protobuf-go,记得改名成protobuf

再次执行 go install github.com/gin-gonic/gin

成功

猜你喜欢

转载自blog.csdn.net/a709046532/article/details/108450087